Commit 40018a8f authored by Dan Carpenter's avatar Dan Carpenter Committed by Kalle Valo

wifi: plfxlc: check for allocation failure in plfxlc_usb_wreq_async()

Check for if the usb_alloc_urb() failed.

Fixes: 68d57a07 ("wireless: add plfxlc driver for pureLiFi X, XL, XC devices")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/e8d4a19a-f251-4101-a89b-607345e938cb@moroto.mountain
parent bec95598
......@@ -493,9 +493,12 @@ int plfxlc_usb_wreq_async(struct plfxlc_usb *usb, const u8 *buffer,
void *context)
{
struct usb_device *udev = interface_to_usbdev(usb->ez_usb);
struct urb *urb = usb_alloc_urb(0, GFP_ATOMIC);
struct urb *urb;
int r;
urb = usb_alloc_urb(0, GFP_ATOMIC);
if (!urb)
return -ENOMEM;
usb_fill_bulk_urb(urb, udev, usb_sndbulkpipe(udev, EP_DATA_OUT),
(void *)buffer, buffer_len, complete_fn, context);
......
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