From: Jukka Rissanen Date: Mon, 29 Sep 2014 07:55:46 +0000 (+0300) Subject: Bluetooth: 6lowpan: Make sure skb exists before accessing it X-Git-Tag: v3.18-rc1~115^2~39^2~16^2~10 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=59790aa2873cb3c32db02c777f08eb19faccf5fa;p=~emulex%2Finfiniband.git 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: Jukka Rissanen Signed-off-by: Marcel Holtmann --- diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c index 0920cb6ed57..5d3e6202da3 100644 --- a/net/bluetooth/6lowpan.c +++ b/net/bluetooth/6lowpan.c @@ -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; }