summaryrefslogtreecommitdiff
path: root/net/bluetooth
diff options
context:
space:
mode:
authorArchie Pusaka <apusaka@chromium.org>2023-01-26 16:38:17 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-02-01 10:23:21 +0300
commit1d580d3e1311c5d28f0f28137cbcb999e9d446d8 (patch)
treefec1ad729c7c14826d8431673e0b307be79c1126 /net/bluetooth
parentb98a8b731bd2a97a2b59d079d14b25472dd0acfd (diff)
downloadlinux-1d580d3e1311c5d28f0f28137cbcb999e9d446d8.tar.xz
Bluetooth: hci_sync: cancel cmd_timer if hci_open failed
commit 97dfaf073f5881c624856ef293be307b6166115c upstream. 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> Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/hci_core.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 2af1477a05ca..08c473aa0113 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1623,6 +1623,7 @@ setup_failed:
hdev->flush(hdev);
if (hdev->sent_cmd) {
+ cancel_delayed_work_sync(&hdev->cmd_timer);
kfree_skb(hdev->sent_cmd);
hdev->sent_cmd = NULL;
}