Commit a35342d0 authored by Sidong Yang's avatar Sidong Yang Committed by Greg Kroah-Hartman

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: default avatarSidong Yang <realwakka@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e7c3d054
...@@ -736,7 +736,7 @@ pi433_tx_thread(void *data) ...@@ -736,7 +736,7 @@ pi433_tx_thread(void *data)
device->free_in_fifo == FIFO_SIZE || device->free_in_fifo == FIFO_SIZE ||
kthread_should_stop()); kthread_should_stop());
if (kthread_should_stop()) if (kthread_should_stop())
dev_dbg(device->dev, "ABORT\n"); return 0;
/* STOP_TRANSMISSION */ /* STOP_TRANSMISSION */
dev_dbg(device->dev, "thread: Packet sent. Set mode to stby."); dev_dbg(device->dev, "thread: Packet sent. Set mode to stby.");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment