]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
Staging: Fix leak in drivers/staging/at76_usb.c
authorDiego Calleja <diegocg@gmail.com>
Sat, 18 Oct 2008 14:53:37 +0000 (16:53 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 22 Oct 2008 16:56:29 +0000 (09:56 -0700)
Fix leak in at76_usb as reported in:
http://bugzilla.kernel.org/show_bug.cgi?id=11778

Reported-by: Daniel Marjamäki <danielm77@spray.se>
Signed-off-by: Diego Calleja <diegocg@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/at76_usb/at76_usb.c

index 52df0c665183cd24e8ad7e14ce1ec83682aa1ae1..174e2bec922323775f9fefa99927bdc98bd71e1d 100644 (file)
@@ -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);