diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2024-01-09 19:45:40 +0100 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2024-03-06 23:22:38 +0100 |
commit | 63298d6e752fc0ec7f5093860af8bc9f047b30c8 (patch) | |
tree | de9da8f2791140f77dff2c423aac9b781c65fe1a /net/bluetooth/mgmt.c | |
parent | Bluetooth: hci_event: Use HCI error defines instead of magic values (diff) | |
download | linux-63298d6e752fc0ec7f5093860af8bc9f047b30c8.tar.xz linux-63298d6e752fc0ec7f5093860af8bc9f047b30c8.zip |
Bluetooth: hci_core: Cancel request on command timeout
If command has timed out call __hci_cmd_sync_cancel to notify the
hci_req since it will inevitably cause a timeout.
This also rework the code around __hci_cmd_sync_cancel since it was
wrongly assuming it needs to cancel timer as well, but sometimes the
timers have not been started or in fact they already had timed out in
which case they don't need to be cancel yet again.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Diffstat (limited to 'net/bluetooth/mgmt.c')
-rw-r--r-- | net/bluetooth/mgmt.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 3fe6db8a0ec0..8c4493255f92 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -1417,7 +1417,7 @@ static int set_powered(struct sock *sk, struct hci_dev *hdev, void *data, /* Cancel potentially blocking sync operation before power off */ if (cp->val == 0x00) { - __hci_cmd_sync_cancel(hdev, -EHOSTDOWN); + hci_cmd_sync_cancel_sync(hdev, -EHOSTDOWN); err = hci_cmd_sync_queue(hdev, set_powered_sync, cmd, mgmt_set_powered_complete); } else { |