Bluetooth: Explicitly stop all timers before frees
As a preventative measure, timers on dynamic memory structures must be
not running, or stopped, prior to freeing. Since it is safe to delete
timers whether running or not, all timers are deleted.
CRs-fixed: 328673
Change-Id: I255d99cb2419fad07caf445920050cf2d05ffe4d
Signed-off-by: Brian Gix <bgix@codeaurora.org>
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index dd1d6e8..97f0775 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1,6 +1,6 @@
/*
BlueZ - Bluetooth protocol stack for Linux
- Copyright (c) 2000-2001, 2010-2011 Code Aurora Forum. All rights reserved.
+ Copyright (c) 2000-2001, 2010-2012 Code Aurora Forum. All rights reserved.
Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com>
@@ -1571,8 +1571,12 @@
hci_unregister_sysfs(hdev);
+ /* Disable all timers */
hci_del_off_timer(hdev);
del_timer(&hdev->adv_timer);
+ del_timer(&hdev->cmd_timer);
+ del_timer(&hdev->disc_timer);
+ del_timer(&hdev->disc_le_timer);
destroy_workqueue(hdev->workqueue);