summaryrefslogtreecommitdiffstats
path: root/net
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-06 07:49:41 +0100
commit14b7058f0d123ab9a814a39ba7cbdc1c56cc5702 (patch)
treee0e9fd060df0103a886a1db4474950c3ef0d2a7b /net
parent23d5769a674cb80808239081b35699d347d88ee3 (diff)
downloadlinux-stable-14b7058f0d123ab9a814a39ba7cbdc1c56cc5702.tar.gz
linux-stable-14b7058f0d123ab9a814a39ba7cbdc1c56cc5702.tar.bz2
linux-stable-14b7058f0d123ab9a814a39ba7cbdc1c56cc5702.zip
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')
-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 e87777255c47..497c8ac140d1 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1519,6 +1519,7 @@ static int hci_dev_do_open(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;
}