Skip to contentSkip to conversation

Bluetooth: Fix keeping the command timer running

PATCH Superseded [email protected] 1 participant 1 message Apr 9, 2011

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Bluetooth: Fix keeping the command timer running

From: Vinicius Costa Gomes <[email protected]>

In the teardown path the reset command is sent to the controller, this event causes the command timer to be reactivated.

Now we remove the timer after the reset command is sent.

---
 net/bluetooth/hci_core.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
net/bluetooth/hci_core.c +3 -3
index a80bc1c..7467eaa 100644
@@ -586,9 +586,6 @@ static int hci_dev_do_close(struct hci_dev *hdev)
 	hci_req_cancel(hdev, ENODEV);
 	hci_req_lock(hdev);
 
-	/* Stop timer, it might be running */
-	del_timer_sync(&hdev->cmd_timer);
-
 	if (!test_and_clear_bit(HCI_UP, &hdev->flags)) {
 		hci_req_unlock(hdev);
 		return 0;
@@ -618,6 +615,9 @@ static int hci_dev_do_close(struct hci_dev *hdev)
 		clear_bit(HCI_INIT, &hdev->flags);
 	}
 
+	/* Stop timer, it might be running */
+	del_timer_sync(&hdev->cmd_timer);
+
 	/* Kill cmd task */
 	tasklet_kill(&hdev->cmd_task);
 
Signature · 1 line
1.7.4.3