NULL check value returned by alloc_skb
PATCH 1/1 NULL check value returned by alloc_skb
Return error ENOMEM if alloc_skb() failed.
Signed-off-by Dhiraj Shah <[email protected]>
--- drivers/bluetooth/virtio_bt.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/bluetooth/virtio_bt.c +2 -0
@@ -34,6 +34,8 @@ static int virtbt_add_inbuf(struct virtio_bluetooth *vbt)int err; skb =alloc_skb (1000 ,GFP_KERNEL ); +if (!skb) +return -ENOMEM ;sg_init_one (sg, skb->data,1000 ); err =virtqueue_add_inbuf (vq, sg,1 , skb,GFP_KERNEL );
Signature · 1 line
2.30.1 (Apple Git-130)
Marcel Holtmann
maintainerHi Dhiraj,
Quoted 12 lines
Return error ENOMEM if
alloc_skb()failed.Signed-off-by Dhiraj Shah <[email protected]>---
drivers/bluetooth/virtio_bt.c| 2 ++1 file changed, 2 insertions(+)drivers/bluetooth/virtio_bt.c +0
-0
drivers/bluetooth/virtio_bt.c static int virtbt_add_inbuf(struct virtio_bluetooth *vbt) · line 41
Quoted 8 lines
drivers/bluetooth/virtio_bt.c +2
-0@@ -34,6 +34,8 @@ static int virtbt_add_inbuf(struct virtio_bluetooth *vbt)int err; skb =alloc_skb (1000 ,GFP_KERNEL ); +if (!skb) +return -ENOMEM ;sg_init_one (sg, skb->data,1000 ); err =virtqueue_add_inbuf (vq, sg,1 , skb,GFP_KERNEL );
a similar patch is already upstream in bluetooth-next.
Regards
Marcel