[PATCH] Fix leak in drivers/staging/at76_usb.c

From: dcg
Date: Sat Oct 18 2008 - 10:53:40 EST


Fix leak in at76_usb as reported in:
http://bugzilla.kernel.org/show_bug.cgi?id=11778


Reported-by: Daniel MarjamÃki <danielm77@xxxxxxxx>
Signed-off-by: Diego Calleja <diegocg@xxxxxxxxx>

Index: 2.6/drivers/staging/at76_usb/at76_usb.c
===================================================================
--- 2.6.orig/drivers/staging/at76_usb/at76_usb.c 2008-10-18 16:19:38.000000000 +0200
+++ 2.6/drivers/staging/at76_usb/at76_usb.c 2008-10-18 16:20:21.000000000 +0200
@@ -2319,9 +2319,11 @@
if (!iwe)
return -ENOMEM;

- if (priv->scan_state != SCAN_COMPLETED)
+ if (priv->scan_state != SCAN_COMPLETED) {
/* scan not yet finished */
+ kfree(iwe);
return -EAGAIN;
+ }

spin_lock_irqsave(&priv->bss_list_spinlock, flags);

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/