Bluetooth: Discovery Timer stability fixes
This change prevents running timers from being re-initialized
which causes system instablility. Also prevents starting a
discovery operation when already in progress.
CRs-fixed: 328673
Change-Id: Icda36a25fdcb40dab4f95f9cc39ca124b299e308
Signed-off-by: Brian Gix <bgix@codeaurora.org>
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 97f0775..47bfde5 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1464,6 +1464,10 @@
skb_queue_head_init(&hdev->raw_q);
setup_timer(&hdev->cmd_timer, hci_cmd_timer, (unsigned long) hdev);
+ setup_timer(&hdev->disco_timer, mgmt_disco_timeout,
+ (unsigned long) hdev);
+ setup_timer(&hdev->disco_le_timer, mgmt_disco_le_timeout,
+ (unsigned long) hdev);
for (i = 0; i < NUM_REASSEMBLY; i++)
hdev->reassembly[i] = NULL;
@@ -1575,8 +1579,8 @@
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);
+ del_timer(&hdev->disco_timer);
+ del_timer(&hdev->disco_le_timer);
destroy_workqueue(hdev->workqueue);