]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
Bluetooth: l2cap: Don't double set the HCI_CONN_MGMT_CONNECTED bit
authorArchie Pusaka <apusaka@chromium.org>
Thu, 4 Apr 2024 10:50:23 +0000 (18:50 +0800)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Wed, 10 Apr 2024 19:10:16 +0000 (15:10 -0400)
The bit is set and tested inside mgmt_device_connected(), therefore we
must not set it just outside the function.

Fixes: eeda1bf97bb5 ("Bluetooth: hci_event: Fix not indicating new connection for BIG Sync")
Signed-off-by: Archie Pusaka <apusaka@chromium.org>
Reviewed-by: Manish Mandlik <mmandlik@chromium.org>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
net/bluetooth/l2cap_core.c

index 467b242d8be071da16bd48d04e1520ce1e1aa8a6..dc089740879363dd0d6d973dcdb4fc05cfc7070a 100644 (file)
@@ -4054,8 +4054,7 @@ static int l2cap_connect_req(struct l2cap_conn *conn,
                return -EPROTO;
 
        hci_dev_lock(hdev);
-       if (hci_dev_test_flag(hdev, HCI_MGMT) &&
-           !test_and_set_bit(HCI_CONN_MGMT_CONNECTED, &hcon->flags))
+       if (hci_dev_test_flag(hdev, HCI_MGMT))
                mgmt_device_connected(hdev, hcon, NULL, 0);
        hci_dev_unlock(hdev);