]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
Bluetooth: fix connection setup in l2cap_connect
authorPauli Virtanen <pav@iki.fi>
Sun, 9 Jun 2024 15:06:20 +0000 (18:06 +0300)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Mon, 10 Jun 2024 13:48:30 +0000 (09:48 -0400)
The amp_id argument of l2cap_connect() was removed in
commit 84a4bb6548a2 ("Bluetooth: HCI: Remove HCI_AMP support")

It was always called with amp_id == 0, i.e. AMP_ID_BREDR == 0x00 (ie.
non-AMP controller).  In the above commit, the code path for amp_id != 0
was preserved, although it should have used the amp_id == 0 one.

Restore the previous behavior of the non-AMP code path, to fix problems
with L2CAP connections.

Fixes: 84a4bb6548a2 ("Bluetooth: HCI: Remove HCI_AMP support")
Signed-off-by: Pauli Virtanen <pav@iki.fi>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
net/bluetooth/l2cap_core.c

index c49e0d4b3c0dd1b7012e29cd0bf033976a5a9d2f..aed025734d04798a8e0f6cf040ce57f031e4d35e 100644 (file)
@@ -4011,8 +4011,8 @@ static void l2cap_connect(struct l2cap_conn *conn, struct l2cap_cmd_hdr *cmd,
                                status = L2CAP_CS_AUTHOR_PEND;
                                chan->ops->defer(chan);
                        } else {
-                               l2cap_state_change(chan, BT_CONNECT2);
-                               result = L2CAP_CR_PEND;
+                               l2cap_state_change(chan, BT_CONFIG);
+                               result = L2CAP_CR_SUCCESS;
                                status = L2CAP_CS_NO_INFO;
                        }
                } else {