Commit fcd156ee authored by Sathish Narasimman's avatar Sathish Narasimman Committed by Marcel Holtmann

Bluetooth: btusb: check for NULL in btusb_find_altsetting()

The new btusb_find_altsetting() dereferences it without checking
the check is added in this patch
Signed-off-by: default avatarSathish Narasimman <sathish.narasimman@intel.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent d1d900f8
......@@ -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];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment