From b834517572d19d34c9cd9adb878aec3138db9224 Mon Sep 17 00:00:00 2001 From: David Chosrova Date: Wed, 1 Dec 2010 13:42:16 +0100 Subject: 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 Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192u/r8192U_core.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/staging/rtl8192u') 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++){ -- cgit v1.2.3-18-g5258