2008-10-18 14:53:38

by Diego Calleja

[permalink] [raw]
Subject: [PATCH] Fix leak in drivers/staging/at76_usb.c

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


Reported-by: Daniel Marjamäki <[email protected]>
Signed-off-by: Diego Calleja <[email protected]>

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);