aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorJukka Rissanen <jukka.rissanen@linux.intel.com>2014-09-29 10:55:46 +0300
committerMarcel Holtmann <marcel@holtmann.org>2014-09-29 10:10:02 +0200
commit59790aa2873cb3c32db02c777f08eb19faccf5fa (patch)
tree724b9fd123e4917332d6ec0682d17720ea1f3bbd /net/bluetooth
parentBluetooth: Rename sco_param_wideband table to esco_param_msbc (diff)
downloadlinux-dev-59790aa2873cb3c32db02c777f08eb19faccf5fa.tar.xz
linux-dev-59790aa2873cb3c32db02c777f08eb19faccf5fa.zip
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 <jukka.rissanen@linux.intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/6lowpan.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c
index 0920cb6ed572..5d3e6202da3d 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;
}