Commit 9fa6b4cd authored by Niels Dossche's avatar Niels Dossche Committed by Marcel Holtmann
Browse files

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: 3c857757 ("Bluetooth: Add directed advertising support through connect()")
Signed-off-by: default avatarNiels Dossche <dossche.niels@gmail.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent ff39fc1b
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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;
	}