Bluetooth: Fix keeping the command timer running

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

So the timer is removed in two situations, when the adapter isn't
marked as UP and when we know that some command has been sent.

Reported-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>

authored by Vinicius Costa Gomes and committed by Gustavo F. Padovan b79f44c1 7a74aeb0

+2 -3
+2 -3
net/bluetooth/hci_core.c
··· 587 hci_req_cancel(hdev, ENODEV); 588 hci_req_lock(hdev); 589 590 - /* Stop timer, it might be running */ 591 - del_timer_sync(&hdev->cmd_timer); 592 - 593 if (!test_and_clear_bit(HCI_UP, &hdev->flags)) { 594 hci_req_unlock(hdev); 595 return 0; 596 } ··· 627 628 /* Drop last sent command */ 629 if (hdev->sent_cmd) { 630 kfree_skb(hdev->sent_cmd); 631 hdev->sent_cmd = NULL; 632 }
··· 587 hci_req_cancel(hdev, ENODEV); 588 hci_req_lock(hdev); 589 590 if (!test_and_clear_bit(HCI_UP, &hdev->flags)) { 591 + del_timer_sync(&hdev->cmd_timer); 592 hci_req_unlock(hdev); 593 return 0; 594 } ··· 629 630 /* Drop last sent command */ 631 if (hdev->sent_cmd) { 632 + del_timer_sync(&hdev->cmd_timer); 633 kfree_skb(hdev->sent_cmd); 634 hdev->sent_cmd = NULL; 635 }