aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiels Dossche <dossche.niels@gmail.com>2022-03-16 16:33:50 +0100
committerMarcel Holtmann <marcel@holtmann.org>2022-03-18 17:12:08 +0100
commit9fa6b4cda3b414e990f008f45f9bcecbcb54d4d1 (patch)
treeff5f33bfe6f7950d45b1bdcf8bfba5c1325f8223
parentBluetooth: Send AdvMonitor Dev Found for all matched devices (diff)
downloadlinux-dev-9fa6b4cda3b414e990f008f45f9bcecbcb54d4d1.tar.xz
linux-dev-9fa6b4cda3b414e990f008f45f9bcecbcb54d4d1.zip
Bluetooth: call hci_le_conn_failed with hdev lock in hci_le_conn_failed
hci_le_conn_failed function's documentation says that the caller must hold hdev->lock. The only callsite that does not hold that lock is hci_le_conn_failed. The other 3 callsites hold the hdev->lock very locally. The solution is to hold the lock during the call to hci_le_conn_failed. Fixes: 3c857757ef6e ("Bluetooth: Add directed advertising support through connect()") Signed-off-by: Niels Dossche <dossche.niels@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
-rw-r--r--net/bluetooth/hci_conn.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index d10651108033..84312c836549 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -669,7 +669,9 @@ static void le_conn_timeout(struct work_struct *work)
if (conn->role == HCI_ROLE_SLAVE) {
/* Disable LE Advertising */
le_disable_advertising(hdev);
+ hci_dev_lock(hdev);
hci_le_conn_failed(conn, HCI_ERROR_ADVERTISING_TIMEOUT);
+ hci_dev_unlock(hdev);
return;
}