projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
636c803
)
Bluetooth: btusb: Fix potential NULL dereference on kmalloc failure
author
Zhongqiu Han
<quic_zhonhan@quicinc.com>
Sat, 5 Jul 2025 10:52:46 +0000
(18:52 +0800)
committer
Luiz Augusto von Dentz
<luiz.von.dentz@intel.com>
Wed, 23 Jul 2025 14:28:30 +0000
(10:28 -0400)
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>
drivers/bluetooth/btusb.c
patch
|
blob
|
history
diff --git
a/drivers/bluetooth/btusb.c
b/drivers/bluetooth/btusb.c
index
b04a4ad
..
8023a2e
100644
(file)
--- a/
drivers/bluetooth/btusb.c
+++ b/
drivers/bluetooth/btusb.c
@@
-3809,6
+3809,8
@@
static int btusb_hci_drv_supported_altsettings(struct hci_dev *hdev, void *data,
/* There are at most 7 alt (0 - 6) */
rp = kmalloc(sizeof(*rp) + 7, GFP_KERNEL);
+ if (!rp)
+ return -ENOMEM;
rp->num = 0;
if (!drvdata->isoc)