Skip to content

Commit 7e74aa5

Browse files
committed
Bluetooth: hci_event: Fix handling of HCI_EV_IO_CAPA_REQUEST
If we received HCI_EV_IO_CAPA_REQUEST while HCI_OP_READ_REMOTE_EXT_FEATURES is yet to be responded assume the remote does support SSP since otherwise this event shouldn't be generated. Link: https://lore.kernel.org/linux-bluetooth/CABBYNZ+9UdG1cMZVmdtN3U2aS16AKMCyTARZZyFX7xTEDWcMOw@mail.gmail.com/T/#t Fixes: c7f5946 ("Bluetooth: Fix a refcnt underflow problem for hci_conn") Signed-off-by: Luiz Augusto von Dentz <[email protected]>
1 parent 0bd1fb5 commit 7e74aa5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

net/bluetooth/hci_event.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5329,9 +5329,12 @@ static void hci_io_capa_request_evt(struct hci_dev *hdev, void *data,
53295329
hci_dev_lock(hdev);
53305330

53315331
conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr);
5332-
if (!conn || !hci_conn_ssp_enabled(conn))
5332+
if (!conn || !hci_dev_test_flag(hdev, HCI_SSP_ENABLED))
53335333
goto unlock;
53345334

5335+
/* Assume remote supports SSP since it has triggered this event */
5336+
set_bit(HCI_CONN_SSP_ENABLED, &conn->flags);
5337+
53355338
hci_conn_hold(conn);
53365339

53375340
if (!hci_dev_test_flag(hdev, HCI_MGMT))

0 commit comments

Comments
 (0)