diff options
author | Sidong Yang <realwakka@gmail.com> | 2019-04-02 12:14:31 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-04-02 19:58:04 +0200 |
commit | a35342d0f8b348fad38e6250f9b646b99aa210c7 (patch) | |
tree | 6f5161d646722d99e725a34e1519ea4f2608c05c | |
parent | e7c3d05459673d21f62a3fd82fa3a1ee6ef8de55 (diff) | |
download | linux-stable-a35342d0f8b348fad38e6250f9b646b99aa210c7.tar.gz linux-stable-a35342d0f8b348fad38e6250f9b646b99aa210c7.tar.bz2 linux-stable-a35342d0f8b348fad38e6250f9b646b99aa210c7.zip |
staging: pi433: Return thread immediately when kthread_should_stop() call.
When kthread_stop() called by removing module, running thread should
return immediately. Otherwise, It is very dangerous that thread may access
any released data like struct pi433_device.
Signed-off-by: Sidong Yang <realwakka@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/pi433/pi433_if.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c index ab90d6f80931..16dc380eb176 100644 --- a/drivers/staging/pi433/pi433_if.c +++ b/drivers/staging/pi433/pi433_if.c @@ -736,7 +736,7 @@ pi433_tx_thread(void *data) device->free_in_fifo == FIFO_SIZE || kthread_should_stop()); if (kthread_should_stop()) - dev_dbg(device->dev, "ABORT\n"); + return 0; /* STOP_TRANSMISSION */ dev_dbg(device->dev, "thread: Packet sent. Set mode to stby."); |