Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Niels Dossche and committed by
Marcel Holtmann
9fa6b4cd ff39fc1b

+2
+2
net/bluetooth/hci_conn.c
··· 669 669 if (conn->role == HCI_ROLE_SLAVE) { 670 670 /* Disable LE Advertising */ 671 671 le_disable_advertising(hdev); 672 + hci_dev_lock(hdev); 672 673 hci_le_conn_failed(conn, HCI_ERROR_ADVERTISING_TIMEOUT); 674 + hci_dev_unlock(hdev); 673 675 return; 674 676 } 675 677