Bluetooth: Use explicit header and body length for L2CAP SKB allocation
[linux-2.6-block.git] / net / bluetooth / a2mp.c
index 1a5b1eb96d1a59a88f7dbb4982b1f571b132c767..0fd8d1dda7092f1bcd24096e86bd1420fd9d417c 100644 (file)
@@ -693,11 +693,12 @@ 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 hdr_len,
                                              unsigned long len, int nb)
 {
        struct sk_buff *skb;
 
-       skb = bt_skb_alloc(len, GFP_KERNEL);
+       skb = bt_skb_alloc(hdr_len + len, GFP_KERNEL);
        if (!skb)
                return ERR_PTR(-ENOMEM);