mirror of
https://github.com/torvalds/linux.git
synced 2024-11-08 05:01:48 +00:00
Bluetooth: btmrvl: fix race issue while stopping main thread
btmrvl_remove_card() calls kthread_stop() to stop the main thread, but kthread_should_stop() is checked when all the activities are done in the main thread before sleeping. We will have kthread_should_stop() check as soon as main thread is woken up. This fixes a crash issue caused due to an invalid memory access while unnecessarily processing interrupts after card removal. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
This commit is contained in:
parent
661cf88acd
commit
8b324fa691
@ -616,6 +616,11 @@ static int btmrvl_service_main_thread(void *data)
|
||||
|
||||
BT_DBG("main_thread woke up");
|
||||
|
||||
if (kthread_should_stop()) {
|
||||
BT_DBG("main_thread: break from main thread");
|
||||
break;
|
||||
}
|
||||
|
||||
spin_lock_irqsave(&priv->driver_lock, flags);
|
||||
if (adapter->int_count) {
|
||||
adapter->int_count = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user