Commit cff2ae21 authored by Devendra Naga's avatar Devendra Naga Committed by Greg Kroah-Hartman

staging: btmtk_usb: check for a valid io_buf pointer

assigned to retval of kmalloc but not checked whether the allocation failed or not,
fail the registering if allocation fail
Signed-off-by: default avatarDevendra Naga <devendra.aaru@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b8313417
...@@ -1597,6 +1597,11 @@ static int btmtk_usb_probe(struct usb_interface *intf, ...@@ -1597,6 +1597,11 @@ static int btmtk_usb_probe(struct usb_interface *intf,
} }
data->io_buf = kmalloc(256, GFP_ATOMIC); data->io_buf = kmalloc(256, GFP_ATOMIC);
if (!data->io_buf) {
hci_free_dev(hdev);
kfree(data);
return -ENOMEM;
}
btmtk_usb_switch_iobase(data, WLAN); btmtk_usb_switch_iobase(data, WLAN);
......
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