summaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorKulikov Vasiliy <segooon@gmail.com>2010-07-16 20:15:06 +0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-08-10 14:35:42 -0700
commit76be932af17ddebac1b4e3dd2565a0519eaa29ce (patch)
tree6ac071f899a4428050af38db8f523cac8c5533c7 /drivers/usb
parenta93917d39fc388c4761d2530af82513e2d3bf9f6 (diff)
downloadlinux-76be932af17ddebac1b4e3dd2565a0519eaa29ce.tar.bz2
usb: host: sl811-hcd: check kzalloc() result
If kzalloc() fails exit with -ENOMEM. Signed-off-by: Kulikov Vasiliy <segooon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/host/sl811-hcd.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/usb/host/sl811-hcd.c b/drivers/usb/host/sl811-hcd.c
index bcf9f0e809de..990f06b89eaa 100644
--- a/drivers/usb/host/sl811-hcd.c
+++ b/drivers/usb/host/sl811-hcd.c
@@ -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);