diff options
author | Kulikov Vasiliy <segooon@gmail.com> | 2010-07-16 20:15:06 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-08-10 14:35:42 -0700 |
commit | 76be932af17ddebac1b4e3dd2565a0519eaa29ce (patch) | |
tree | 6ac071f899a4428050af38db8f523cac8c5533c7 /drivers | |
parent | a93917d39fc388c4761d2530af82513e2d3bf9f6 (diff) | |
download | op-kernel-dev-76be932af17ddebac1b4e3dd2565a0519eaa29ce.zip op-kernel-dev-76be932af17ddebac1b4e3dd2565a0519eaa29ce.tar.gz |
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')
-rw-r--r-- | drivers/usb/host/sl811-hcd.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/usb/host/sl811-hcd.c b/drivers/usb/host/sl811-hcd.c index bcf9f0e..990f06b 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); |