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

Commit 59790aa2 authored by Jukka Rissanen's avatar Jukka Rissanen Committed by Marcel Holtmann
Browse files

Bluetooth: 6lowpan: Make sure skb exists before accessing it



We need to make sure that the saved skb exists when
resuming or suspending a CoC channel. This can happen if
initial credits is 0 when channel is connected.

Signed-off-by: default avatarJukka Rissanen <jukka.rissanen@linux.intel.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 565766b0
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -950,6 +950,9 @@ static void chan_suspend_cb(struct l2cap_chan *chan)

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

	if (!skb)
		return;

	lowpan_cb(skb)->status = -EAGAIN;
}

@@ -959,6 +962,9 @@ static void chan_resume_cb(struct l2cap_chan *chan)

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

	if (!skb)
		return;

	lowpan_cb(skb)->status = 0;
}