linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Staging: rtl8192u: check return code kmalloc.
@ 2010-12-01 12:42 David Chosrova
  0 siblings, 0 replies; only message in thread
From: David Chosrova @ 2010-12-01 12:42 UTC (permalink / raw)
  To: gregkh; +Cc: devel, error27, andreamrl, linux-wireless, kernel-janitors

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>

---
Compiled

diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c
index 494f180..67ba8f7 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -2203,6 +2203,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++){

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-12-01 12:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-01 12:42 [PATCH] Staging: rtl8192u: check return code kmalloc David Chosrova

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).