projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d1d900f
)
Bluetooth: btusb: check for NULL in btusb_find_altsetting()
author
Sathish Narasimman
<nsathish41@gmail.com>
Wed, 8 Apr 2020 05:27:03 +0000
(10:57 +0530)
committer
Marcel Holtmann
<marcel@holtmann.org>
Wed, 8 Apr 2020 06:16:56 +0000
(08:16 +0200)
The new btusb_find_altsetting() dereferences it without checking
the check is added in this patch
Signed-off-by: Sathish Narasimman <sathish.narasimman@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
drivers/bluetooth/btusb.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/bluetooth/btusb.c
b/drivers/bluetooth/btusb.c
index 09913cadd1ca11c046a4d428180fd9ef8b42ca32..871162790a0ed17dfb5b8e3136460dc58098058f 100644
(file)
--- a/
drivers/bluetooth/btusb.c
+++ b/
drivers/bluetooth/btusb.c
@@
-1622,6
+1622,9
@@
static struct usb_host_interface *btusb_find_altsetting(struct btusb_data *data,
BT_DBG("Looking for Alt no :%d", alt);
+ if (!intf)
+ return NULL;
+
for (i = 0; i < intf->num_altsetting; i++) {
if (intf->altsetting[i].desc.bAlternateSetting == alt)
return &intf->altsetting[i];