diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2015-11-12 08:15:00 -0500 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2015-11-19 11:50:32 -0500 |
commit | 7df0f73ece45c2e499b416cbc90949e0226eb134 (patch) | |
tree | e07322a53cfadfec37c14ede429ddcb0d4ced240 /net/bluetooth/hci_request.c | |
parent | e2caced40734731e2a17b501840809e30a08141a (diff) |
Bluetooth: Simplify request cleanup code
The hci_req_sync_cancel() is just as much related to the request
cleanup as hci_request_cancel_all() is. Just move the former into the
latter and do the cleanup from a single place in hci_dev_do_close().
The important thing is to avoid deadlocks by holding the req_sync
lock: previously hci_request_cancel_all was done right after releasing
the lock and with this patch it's right before taking it.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/hci_request.c')
-rw-r--r-- | net/bluetooth/hci_request.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/bluetooth/hci_request.c b/net/bluetooth/hci_request.c index e8345d8106b5..76bd912be9fe 100644 --- a/net/bluetooth/hci_request.c +++ b/net/bluetooth/hci_request.c | |||
@@ -1270,6 +1270,8 @@ void hci_request_setup(struct hci_dev *hdev) | |||
1270 | 1270 | ||
1271 | void hci_request_cancel_all(struct hci_dev *hdev) | 1271 | void hci_request_cancel_all(struct hci_dev *hdev) |
1272 | { | 1272 | { |
1273 | hci_req_sync_cancel(hdev, ENODEV); | ||
1274 | |||
1273 | cancel_work_sync(&hdev->discov_update); | 1275 | cancel_work_sync(&hdev->discov_update); |
1274 | cancel_work_sync(&hdev->bg_scan_update); | 1276 | cancel_work_sync(&hdev->bg_scan_update); |
1275 | cancel_delayed_work_sync(&hdev->le_scan_disable); | 1277 | cancel_delayed_work_sync(&hdev->le_scan_disable); |