aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKulikov Vasiliy <segooon@gmail.com>2010-07-16 12:15:06 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-08-10 17:35:42 -0400
commit76be932af17ddebac1b4e3dd2565a0519eaa29ce (patch)
tree6ac071f899a4428050af38db8f523cac8c5533c7
parenta93917d39fc388c4761d2530af82513e2d3bf9f6 (diff)
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>
-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(
813#endif 813#endif
814 814
815 /* avoid all allocations within spinlocks */ 815 /* avoid all allocations within spinlocks */
816 if (!hep->hcpriv) 816 if (!hep->hcpriv) {
817 ep = kzalloc(sizeof *ep, mem_flags); 817 ep = kzalloc(sizeof *ep, mem_flags);
818 if (ep == NULL)
819 return -ENOMEM;
820 }
818 821
819 spin_lock_irqsave(&sl811->lock, flags); 822 spin_lock_irqsave(&sl811->lock, flags);
820 823