History

Bluetooth: hci_sync: fix hci_conn_del() use in hci_le_create_conn_sync

hci_conn_del() caller must hold hdev->lock, check the conn was not concurrently deleted, and usually inform socket the conn is going to be deleted. Use hci_abort_conn_sync() instead of calling hci_conn_del() without locks etc.

Pauli Virtanen committed 3 months ago

Commit 2c1e4e01 parent abf97531 file · +3 −1Browse files

Unified · Split

net/bluetooth/hci_sync.c+3−1
@@ -6757,7 +6757,9 @@ static int hci_le_create_conn_sync(struct hci_dev *hdev, void *data) · 6756 unmodified lines
6757 if (hci_dev_test_flag(hdev, HCI_LE_SCAN) &&6757 if (hci_dev_test_flag(hdev, HCI_LE_SCAN) &&
6758 hdev->le_scan_type == LE_SCAN_ACTIVE &&6758 hdev->le_scan_type == LE_SCAN_ACTIVE &&
6759 !hci_dev_test_flag(hdev, HCI_LE_SIMULTANEOUS_ROLES)) {6759 !hci_dev_test_flag(hdev, HCI_LE_SIMULTANEOUS_ROLES)) {
6760 hci_conn_del(conn);6760 conn->state = BT_OPEN;
6761 hci_abort_conn_sync(hdev, conn,
6762 HCI_ERROR_REJ_LIMITED_RESOURCES);
6761 hci_conn_put(conn);6763 hci_conn_put(conn);
6762 return -EBUSY;6764 return -EBUSY;
6763 }6765 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t