This is a note to let you know that I've just added the patch titled Bluetooth: hci_event: Fix checking conn for le_conn_complete_evt to the 5.19-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: bluetooth-hci_event-fix-checking-conn-for-le_conn_co.patch and it can be found in the queue-5.19 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 970e90bfae2c7ba0abf9469f273ad22d3197d8b8 Author: Archie Pusaka <apusaka@xxxxxxxxxxxx> Date: Tue Aug 23 12:39:22 2022 +0800 Bluetooth: hci_event: Fix checking conn for le_conn_complete_evt [ Upstream commit f48735a9aaf8258f39918e13adf464ccd7dce33b ] To prevent multiple conn complete events, we shouldn't look up the conn with hci_lookup_le_connect, since it requires the state to be BT_CONNECT. By the time the duplicate event is processed, the state might have changed, so we end up processing the new event anyway. Change the lookup function to hci_conn_hash_lookup_ba. Fixes: d5ebaa7c5f6f6 ("Bluetooth: hci_event: Ignore multiple conn complete events") Signed-off-by: Archie Pusaka <apusaka@xxxxxxxxxxxx> Reviewed-by: Sonny Sasaka <sonnysasaka@xxxxxxxxxxxx> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 67c61f5240596..2c320a8fe70d7 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c @@ -5568,7 +5568,7 @@ static void le_conn_complete_evt(struct hci_dev *hdev, u8 status, */ hci_dev_clear_flag(hdev, HCI_LE_ADV); - conn = hci_lookup_le_connect(hdev); + conn = hci_conn_hash_lookup_ba(hdev, LE_LINK, bdaddr); if (!conn) { /* In case of error status and there is no connection pending * just unlock as there is nothing to cleanup.