diff options
author | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2012-12-21 22:22:53 -0500 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2014-03-07 13:09:41 -0500 |
commit | 0753c182ef11e27f8f3dea2dc9ca4bcf40019eb5 (patch) | |
tree | 46344bf69ff8d78cda46013792c22d1f4e7f1f62 /net | |
parent | b9e2535acad8f52a17e2aa843d45a6b756b59592 (diff) |
Bluetooth: Fix skb allocation check for A2MP
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>
Diffstat (limited to 'net')
-rw-r--r-- | net/bluetooth/a2mp.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/net/bluetooth/a2mp.c b/net/bluetooth/a2mp.c index f986b9968bdb..d6bb096ba0f1 100644 --- a/net/bluetooth/a2mp.c +++ b/net/bluetooth/a2mp.c | |||
@@ -695,7 +695,13 @@ static void a2mp_chan_state_change_cb(struct l2cap_chan *chan, int state, | |||
695 | static struct sk_buff *a2mp_chan_alloc_skb_cb(struct l2cap_chan *chan, | 695 | static struct sk_buff *a2mp_chan_alloc_skb_cb(struct l2cap_chan *chan, |
696 | unsigned long len, int nb) | 696 | unsigned long len, int nb) |
697 | { | 697 | { |
698 | return bt_skb_alloc(len, GFP_KERNEL); | 698 | struct sk_buff *skb; |
699 | |||
700 | skb = bt_skb_alloc(len, GFP_KERNEL); | ||
701 | if (!skb) | ||
702 | return ERR_PTR(-ENOMEM); | ||
703 | |||
704 | return skb; | ||
699 | } | 705 | } |
700 | 706 | ||
701 | static struct l2cap_ops a2mp_chan_ops = { | 707 | static struct l2cap_ops a2mp_chan_ops = { |