Skip to content

Commit

Permalink
usb: host: sl811-hcd: check kzalloc() result
Browse files Browse the repository at this point in the history
If kzalloc() fails exit with -ENOMEM.

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Kulikov Vasiliy authored and Greg Kroah-Hartman committed Aug 10, 2010
1 parent a93917d commit 76be932
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/usb/host/sl811-hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -813,8 +813,11 @@ static int sl811h_urb_enqueue(
#endif

/* avoid all allocations within spinlocks */
if (!hep->hcpriv)
if (!hep->hcpriv) {
ep = kzalloc(sizeof *ep, mem_flags);
if (ep == NULL)
return -ENOMEM;
}

spin_lock_irqsave(&sl811->lock, flags);

Expand Down

0 comments on commit 76be932

Please sign in to comment.