Skip to content

Commit 4989bb0

Browse files
rostedtgregkh
authored andcommitted
Bluetooth: hci_qca: Use del_timer_sync() before freeing
commit 72ef984 upstream. While looking at a crash report on a timer list being corrupted, which usually happens when a timer is freed while still active. This is commonly triggered by code calling del_timer() instead of del_timer_sync() just before freeing. One possible culprit is the hci_qca driver, which does exactly that. Eric mentioned that wake_retrans_timer could be rearmed via the work queue, so also move the destruction of the work queue before del_timer_sync(). Cc: Eric Dumazet <eric.dumazet@gmail.com> Cc: stable@vger.kernel.org Fixes: 0ff252c ("Bluetooth: hciuart: Add support QCA chipset for UART") Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org> Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent fae05b2 commit 4989bb0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/bluetooth/hci_qca.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -689,9 +689,9 @@ static int qca_close(struct hci_uart *hu)
689689
skb_queue_purge(&qca->tx_wait_q);
690690
skb_queue_purge(&qca->txq);
691691
skb_queue_purge(&qca->rx_memdump_q);
692-
del_timer(&qca->tx_idle_timer);
693-
del_timer(&qca->wake_retrans_timer);
694692
destroy_workqueue(qca->workqueue);
693+
del_timer_sync(&qca->tx_idle_timer);
694+
del_timer_sync(&qca->wake_retrans_timer);
695695
qca->hu = NULL;
696696

697697
kfree_skb(qca->rx_skb);

0 commit comments

Comments
 (0)