]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
Bluetooth: hci_sync: cancel cmd_timer if hci_open failed
authorArchie Pusaka <apusaka@chromium.org>
Wed, 5 Oct 2022 07:09:47 +0000 (15:09 +0800)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Mon, 12 Dec 2022 22:19:23 +0000 (14:19 -0800)
If a command is already sent, we take care of freeing it, but we
also need to cancel the timeout as well.

Signed-off-by: Archie Pusaka <apusaka@chromium.org>
Reviewed-by: Abhishek Pandit-Subedi <abhishekpandit@google.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
net/bluetooth/hci_sync.c

index 1cd05072dbb7c9273707377994d2d02e5cc53e1c..4debe205d4af35f1389c312e8f008ebcc11613ab 100644 (file)
@@ -4721,6 +4721,7 @@ int hci_dev_open_sync(struct hci_dev *hdev)
                        hdev->flush(hdev);
 
                if (hdev->sent_cmd) {
+                       cancel_delayed_work_sync(&hdev->cmd_timer);
                        kfree_skb(hdev->sent_cmd);
                        hdev->sent_cmd = NULL;
                }