aboutsummaryrefslogtreecommitdiff
path: root/drivers/staging/rtl8192u
diff options
context:
space:
mode:
authorDavid Chosrova <david.chosrova@libertysurf.fr>2010-12-01 13:42:16 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2010-12-01 14:53:34 -0800
commitb834517572d19d34c9cd9adb878aec3138db9224 (patch)
treeb22f8aa203cb0dc3eb7486d1e681b48773145ef7 /drivers/staging/rtl8192u
parent8c66be9203d891ea37346a78925f0e6534b98bd3 (diff)
Staging: rtl8192u: check return code kmalloc.
This patch checks the return code of kmalloc when trying to allocate memory for priv->rx_urb in rtl8192_usb_initendpoints(), return -ENOMEM when failed. Signed-off-by: David Chosrova <david.chosrova@libertysurf.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/rtl8192u')
-rw-r--r--drivers/staging/rtl8192u/r8192U_core.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c
index 9cd41b69816..ae4f2b9d9e8 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -2198,6 +2198,8 @@ short rtl8192_usb_initendpoints(struct net_device *dev)
priv->rx_urb = kmalloc(sizeof(struct urb *) * (MAX_RX_URB+1),
GFP_KERNEL);
+ if (priv->rx_urb == NULL)
+ return -ENOMEM;
#ifndef JACKSON_NEW_RX
for(i=0;i<(MAX_RX_URB+1);i++){