]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
Bluetooth: Fix skb allocation check for A2MP
authorGustavo Padovan <gustavo.padovan@collabora.co.uk>
Sat, 22 Dec 2012 03:22:53 +0000 (01:22 -0200)
committerJohan Hedberg <johan.hedberg@intel.com>
Fri, 7 Mar 2014 18:09:41 +0000 (20:09 +0200)
vtable's method alloc_skb() needs to return a ERR_PTR in case of err and
not a NULL.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
net/bluetooth/a2mp.c

index f986b9968bdb8845c6747e9f29205e03090627f7..d6bb096ba0f1ab5e1a681b82c5c5a52c13e822a7 100644 (file)
@@ -695,7 +695,13 @@ static void a2mp_chan_state_change_cb(struct l2cap_chan *chan, int state,
 static struct sk_buff *a2mp_chan_alloc_skb_cb(struct l2cap_chan *chan,
                                              unsigned long len, int nb)
 {
-       return bt_skb_alloc(len, GFP_KERNEL);
+       struct sk_buff *skb;
+
+       skb = bt_skb_alloc(len, GFP_KERNEL);
+       if (!skb)
+               return ERR_PTR(-ENOMEM);
+
+       return skb;
 }
 
 static struct l2cap_ops a2mp_chan_ops = {