From: Luiz Augusto von Dentz Date: Mon, 31 Oct 2022 23:10:33 +0000 (-0700) Subject: Bluetooth: L2CAP: Fix l2cap_global_chan_by_psm X-Git-Tag: v5.15.92~2100 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=41e37d04e397ea8dd3bf0e74065703ca6c43c9e9;p=platform%2Fkernel%2Flinux-rpi.git Bluetooth: L2CAP: Fix l2cap_global_chan_by_psm [ Upstream commit f937b758a188d6fd328a81367087eddbb2fce50f ] l2cap_global_chan_by_psm shall not return fixed channels as they are not meant to be connected by (S)PSM. Signed-off-by: Luiz Augusto von Dentz Reviewed-by: Tedd Ho-Jeong An Signed-off-by: Sasha Levin --- diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index 16f954a..761efd7 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c @@ -1990,7 +1990,7 @@ static struct l2cap_chan *l2cap_global_chan_by_psm(int state, __le16 psm, if (link_type == LE_LINK && c->src_type == BDADDR_BREDR) continue; - if (c->psm == psm) { + if (c->chan_type != L2CAP_CHAN_FIXED && c->psm == psm) { int src_match, dst_match; int src_any, dst_any;