Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit af1c0134 authored by Johan Hedberg's avatar Johan Hedberg Committed by Gustavo Padovan
Browse files

Bluetooth: Remove unnecessary L2CAP channel state check



In l2cap_att_channel() we're only interested in the BT_CONNECTED state
so this state can directly be passed to l2cap_global_chan_by_scid().
This way there's no need to do any additional state check later.

Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
Acked-by: default avatarMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: default avatarGustavo Padovan <gustavo.padovan@collabora.co.uk>
parent 60bac184
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -6394,16 +6394,13 @@ static void l2cap_att_channel(struct l2cap_conn *conn,
{
	struct l2cap_chan *chan;

	chan = l2cap_global_chan_by_scid(0, L2CAP_CID_ATT,
	chan = l2cap_global_chan_by_scid(BT_CONNECTED, L2CAP_CID_ATT,
					 conn->src, conn->dst);
	if (!chan)
		goto drop;

	BT_DBG("chan %p, len %d", chan, skb->len);

	if (chan->state != BT_BOUND && chan->state != BT_CONNECTED)
		goto drop;

	if (chan->imtu < skb->len)
		goto drop;