wl12xx: fix a memory leak of probereq template upon recovery
authorEyal Shapira <eyal@wizery.com>
Mon, 19 Mar 2012 10:06:27 +0000 (12:06 +0200)
committerLuciano Coelho <coelho@ti.com>
Tue, 10 Apr 2012 09:42:49 +0000 (12:42 +0300)
wlvif->probereq is zeroed when adding an interface but
the skb pointed to isn't freed when the interface is removed.
This would lead to a mem leak on every recovery.
Fix it by freeing the skb when removing the interface.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
drivers/net/wireless/wl12xx/main.c

index e21d21d7de8e493551150ee6dc0433f6324ca61a..b560f2d2837ba17644897976c6cdffee857d7369 100644 (file)
@@ -2358,6 +2358,8 @@ deinit:
                wl1271_free_ap_keys(wl, wlvif);
        }
 
+       dev_kfree_skb(wlvif->probereq);
+       wlvif->probereq = NULL;
        wl12xx_tx_reset_wlvif(wl, wlvif);
        if (wl->last_wlvif == wlvif)
                wl->last_wlvif = NULL;