From: Eyal Shapira Date: Mon, 19 Mar 2012 10:06:27 +0000 (+0200) Subject: wl12xx: fix a memory leak of probereq template upon recovery X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=3eba4a0e6db9ca225bc0f3042d60fcfc86a30bc8;p=openwrt%2Fstaging%2Fblogic.git wl12xx: fix a memory leak of probereq template upon recovery 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 Signed-off-by: Luciano Coelho --- diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c index e21d21d7de8e..b560f2d2837b 100644 --- a/drivers/net/wireless/wl12xx/main.c +++ b/drivers/net/wireless/wl12xx/main.c @@ -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;