Staging: 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 <danielm77@spray.se>
Signed-off-by: Diego Calleja <diegocg@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Diego Calleja 2008-10-18 16:53:37 +02:00 committed by Greg Kroah-Hartman
parent 19cbd3d7d5
commit f31158c9f8

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