diff options
author | Philip Cuadra <philipcuadra@google.com> | 2017-07-05 21:08:22 -0700 |
---|---|---|
committer | Michael Bestas <mkbestas@lineageos.org> | 2019-12-23 23:43:34 +0200 |
commit | 17af297b4afccee935656851714b4b63369ae303 (patch) | |
tree | 8ccb14a4bd3e6f02459a5940429fcc9883da106a /drivers/tty/tty_buffer.c | |
parent | 39211e0b21d8eba20e1e04eef528b44590986329 (diff) |
tty: check before stopping kthread
Kthread allocation can fail, so check that it's not an error value
before trying to stop it.
Bug: 63354008
Test: build & run bluetooth audio
Signed-off-by: Philip Cuadra <philipcuadra@google.com>
Change-Id: Ia8a91645beef2b4df64582b9059272f6df8ad4a9
Diffstat (limited to 'drivers/tty/tty_buffer.c')
-rw-r--r-- | drivers/tty/tty_buffer.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/tty/tty_buffer.c b/drivers/tty/tty_buffer.c index 8917b6f87b04..92af201f9030 100644 --- a/drivers/tty/tty_buffer.c +++ b/drivers/tty/tty_buffer.c @@ -132,7 +132,8 @@ void tty_buffer_free_all(struct tty_port *port) buf->tail = &buf->sentinel; atomic_set(&buf->mem_used, 0); - kthread_stop(port->worker_thread); + if (!IS_ERR_OR_NULL(port->worker_thread)) + kthread_stop(port->worker_thread); } /** |