From f31158c9f86bf5619ab2e1c54f82f04ad2f47435 Mon Sep 17 00:00:00 2001 From: Diego Calleja Date: Sat, 18 Oct 2008 16:53:37 +0200 Subject: [PATCH] Staging: Fix leak in drivers/staging/at76_usb.c MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fix leak in at76_usb as reported in: http://bugzilla.kernel.org/show_bug.cgi?id=11778 Reported-by: Daniel Marjamäki Signed-off-by: Diego Calleja Signed-off-by: Greg Kroah-Hartman --- drivers/staging/at76_usb/at76_usb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/staging/at76_usb/at76_usb.c b/drivers/staging/at76_usb/at76_usb.c index 52df0c66518..174e2bec922 100644 --- a/drivers/staging/at76_usb/at76_usb.c +++ b/drivers/staging/at76_usb/at76_usb.c @@ -2319,9 +2319,11 @@ static int at76_iw_handler_get_scan(struct net_device *netdev, 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); -- 2.41.1