Skip to content

Commit

Permalink
Staging: rtl8192u: check return code kmalloc.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David Chosrova authored and Greg Kroah-Hartman committed Dec 1, 2010
1 parent 8c66be9 commit b834517
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/staging/rtl8192u/r8192U_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++){
Expand Down

0 comments on commit b834517

Please sign in to comment.