[PATCH 3/3] Fix memory leakage

Pontus Fuchs pontus.fuchs at gmail.com
Mon Jun 10 11:49:03 EDT 2013


On 2013-06-10 15:27, Eugene Krasnikov wrote:
> Whenever skb is requested from mac80211 do not forget
> to free it.
>
> Signed-off-by: Eugene Krasnikov <k.eugene.e at gmail.com>
> ---

[...]
> @@ -362,6 +362,8 @@ static void wcn36xx_bss_info_changed(struct ieee80211_hw *hw,
>   		wcn36xx_dbg(WCN36XX_DBG_MAC, "mac bss changed ap probe resp");
>   		skb = ieee80211_proberesp_get(hw, vif);
>   		wcn36xx_smd_update_proberesp_tmpl(wcn, skb);
> +		dev_kfree_skb(skb);
> +		skb = NULL;

I see no point in setting skb to NULL. Consider adding a nullcheck after 
the allocation.

>   
>   	if (changed & BSS_CHANGED_BEACON_ENABLED) {
> @@ -377,6 +379,8 @@ static void wcn36xx_bss_info_changed(struct ieee80211_hw *hw,
>   					       wcn->addresses[0].addr, false,
>   					       wcn->beacon_interval);
>   			wcn36xx_smd_send_beacon(wcn, skb, tim_off, 0);
> +			dev_kfree_skb(skb);
> +			skb = NULL;

Same here.

Cheers,

Pontus



More information about the wcn36xx mailing list