Commit b8345175 authored by David Chosrova's avatar David Chosrova Committed by Greg Kroah-Hartman

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: default avatarDavid Chosrova <david.chosrova@libertysurf.fr>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 8c66be92
...@@ -2198,6 +2198,8 @@ short rtl8192_usb_initendpoints(struct net_device *dev) ...@@ -2198,6 +2198,8 @@ short rtl8192_usb_initendpoints(struct net_device *dev)
priv->rx_urb = kmalloc(sizeof(struct urb *) * (MAX_RX_URB+1), priv->rx_urb = kmalloc(sizeof(struct urb *) * (MAX_RX_URB+1),
GFP_KERNEL); GFP_KERNEL);
if (priv->rx_urb == NULL)
return -ENOMEM;
#ifndef JACKSON_NEW_RX #ifndef JACKSON_NEW_RX
for(i=0;i<(MAX_RX_URB+1);i++){ for(i=0;i<(MAX_RX_URB+1);i++){
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment