public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: hci_event: Fix checking conn for le_conn_complete_evt
@ 2022-08-23  4:39 Archie Pusaka
  2022-08-23  5:25 ` bluez.test.bot
  2022-08-24 22:30 ` [PATCH] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 3+ messages in thread
From: Archie Pusaka @ 2022-08-23  4:39 UTC (permalink / raw)
  To: linux-bluetooth, Luiz Augusto von Dentz, Marcel Holtmann
  Cc: CrosBT Upstreaming, Archie Pusaka, Sonny Sasaka, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Johan Hedberg, Paolo Abeni,
	Soenke Huster, linux-kernel, netdev

From: Archie Pusaka <apusaka@chromium.org>

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@chromium.org>
Reviewed-by: Sonny Sasaka <sonnysasaka@chromium.org>

---

 net/bluetooth/hci_event.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 938abe6352bf..1906822a061b 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -5801,7 +5801,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.
-- 
2.37.1.595.g718a3a8f04-goog


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: Bluetooth: hci_event: Fix checking conn for le_conn_complete_evt
  2022-08-23  4:39 [PATCH] Bluetooth: hci_event: Fix checking conn for le_conn_complete_evt Archie Pusaka
@ 2022-08-23  5:25 ` bluez.test.bot
  2022-08-24 22:30 ` [PATCH] " patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2022-08-23  5:25 UTC (permalink / raw)
  To: linux-bluetooth, apusaka

[-- Attachment #1: Type: text/plain, Size: 1100 bytes --]

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=670004

---Test result---

Test Summary:
CheckPatch                    PASS      1.63 seconds
GitLint                       PASS      1.00 seconds
SubjectPrefix                 PASS      0.87 seconds
BuildKernel                   PASS      35.04 seconds
BuildKernel32                 PASS      30.50 seconds
Incremental Build with patchesPASS      43.10 seconds
TestRunner: Setup             PASS      490.36 seconds
TestRunner: l2cap-tester      PASS      18.29 seconds
TestRunner: bnep-tester       PASS      7.13 seconds
TestRunner: mgmt-tester       PASS      107.36 seconds
TestRunner: rfcomm-tester     PASS      10.62 seconds
TestRunner: sco-tester        PASS      10.54 seconds
TestRunner: smp-tester        PASS      10.42 seconds
TestRunner: userchan-tester   PASS      7.52 seconds



---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Bluetooth: hci_event: Fix checking conn for le_conn_complete_evt
  2022-08-23  4:39 [PATCH] Bluetooth: hci_event: Fix checking conn for le_conn_complete_evt Archie Pusaka
  2022-08-23  5:25 ` bluez.test.bot
@ 2022-08-24 22:30 ` patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+bluetooth @ 2022-08-24 22:30 UTC (permalink / raw)
  To: Archie Pusaka
  Cc: linux-bluetooth, luiz.dentz, marcel,
	chromeos-bluetooth-upstreaming, apusaka, sonnysasaka, davem,
	edumazet, kuba, johan.hedberg, pabeni, soenke.huster,
	linux-kernel, netdev

Hello:

This patch was applied to bluetooth/bluetooth-next.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Tue, 23 Aug 2022 12:39:22 +0800 you wrote:
> From: Archie Pusaka <apusaka@chromium.org>
> 
> 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.
> 
> [...]

Here is the summary with links:
  - Bluetooth: hci_event: Fix checking conn for le_conn_complete_evt
    https://git.kernel.org/bluetooth/bluetooth-next/c/045f23cf75a8

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-08-24 22:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-23  4:39 [PATCH] Bluetooth: hci_event: Fix checking conn for le_conn_complete_evt Archie Pusaka
2022-08-23  5:25 ` bluez.test.bot
2022-08-24 22:30 ` [PATCH] " patchwork-bot+bluetooth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox