mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-19 10:44:14 +08:00
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>
This commit is contained in:
parent
e7c3d05459
commit
a35342d0f8
@ -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.");
|
||||
|
Loading…
Reference in New Issue
Block a user