summaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/sl811-hcd.c
diff options
context:
space:
mode:
authorKulikov Vasiliy <segooon@gmail.com>2010-07-16 18:15:06 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2010-08-10 23:35:42 +0200
commit76be932af17ddebac1b4e3dd2565a0519eaa29ce (patch)
tree6ac071f899a4428050af38db8f523cac8c5533c7 /drivers/usb/host/sl811-hcd.c
parentUSB: gadget: storage: optional SCSI WRITE FUA bit (diff)
downloadlinux-76be932af17ddebac1b4e3dd2565a0519eaa29ce.tar.xz
linux-76be932af17ddebac1b4e3dd2565a0519eaa29ce.zip
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/host/sl811-hcd.c')
-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);