Skip to content

Commit

Permalink
Staging: tm6000: check usb_alloc_urb() return
Browse files Browse the repository at this point in the history
usb_alloc_urb() can return NULL so check for that and return
-ENOMEM if it happens.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Dan Carpenter authored and Greg Kroah-Hartman committed Jan 21, 2011
1 parent b01627c commit 2591418
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/staging/tm6000/tm6000-input.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,8 @@ int tm6000_ir_int_start(struct tm6000_core *dev)
return -ENODEV;

ir->int_urb = usb_alloc_urb(0, GFP_KERNEL);
if (!ir->int_urb)
return -ENOMEM;

pipe = usb_rcvintpipe(dev->udev,
dev->int_in.endp->desc.bEndpointAddress
Expand Down

0 comments on commit 2591418

Please sign in to comment.