Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Bluetooth: btusb: Fix potential NULL dereference on kmalloc failure

Avoid potential NULL pointer dereference by checking the return value of
kmalloc and handling allocation failure properly.

Fixes: 7d70989fcea7 ("Bluetooth: btusb: Add HCI Drv commands for configuring altsetting")
Signed-off-by: Zhongqiu Han <quic_zhonhan@quicinc.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

authored by

Zhongqiu Han and committed by
Luiz Augusto von Dentz
b505902c 636c803f

+2
+2
drivers/bluetooth/btusb.c
··· 3809 3809 3810 3810 /* There are at most 7 alt (0 - 6) */ 3811 3811 rp = kmalloc(sizeof(*rp) + 7, GFP_KERNEL); 3812 + if (!rp) 3813 + return -ENOMEM; 3812 3814 3813 3815 rp->num = 0; 3814 3816 if (!drvdata->isoc)