mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-08 14:13:53 +00:00
[PATCH] Bluetooth: fix potential NULL ptr deref in dtl1_cs.c::dtl1_hci_send_frame()
There's a problem in drivers/bluetooth/dtl1_cs.c::dtl1_hci_send_frame() If bt_skb_alloc() returns NULL, then skb_reserve(s, NSHL); will cause a NULL pointer deref - ouch. If we can't allocate the resources we require we need to tell the caller by returning -ENOMEM. Found by the coverity checker as bug #409 Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
81615b624a
commit
57136ca6d5
@ -423,6 +423,9 @@ static int dtl1_hci_send_frame(struct sk_buff *skb)
|
||||
nsh.len = skb->len;
|
||||
|
||||
s = bt_skb_alloc(NSHL + skb->len + 1, GFP_ATOMIC);
|
||||
if (!s)
|
||||
return -ENOMEM;
|
||||
|
||||
skb_reserve(s, NSHL);
|
||||
memcpy(skb_put(s, skb->len), skb->data, skb->len);
|
||||
if (skb->len & 0x0001)
|
||||
|
Loading…
Reference in New Issue
Block a user