mirror of https://gitee.com/openkylin/linux.git
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: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
b8313417e5
commit
cff2ae2185
|
@ -1597,6 +1597,11 @@ static int btmtk_usb_probe(struct usb_interface *intf,
|
|||
}
|
||||
|
||||
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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue