[PATCH] Fix memory leakage

Kalle Valo kvalo at qca.qualcomm.com
Wed Jun 12 02:18:36 EDT 2013


Eugene Krasnikov <k.eugene.e at gmail.com> writes:

> Whenever skb is requested from mac80211 do not forget
> to free it.
>
> Signed-off-by: Eugene Krasnikov <k.eugene.e at gmail.com>

[...]

> @@ -371,12 +375,16 @@ static void wcn36xx_bss_info_changed(struct ieee80211_hw *hw,
>  
>  		if (bss_conf->enable_beacon) {
>  			wcn->beacon_enable = true;
> -			skb = ieee80211_beacon_get_tim(hw, vif, &tim_off,
> -						       &tim_len);
>  			wcn36xx_smd_config_bss(wcn, wcn->iftype,
>  					       wcn->addresses[0].addr, false,
>  					       wcn->beacon_interval);
> -			wcn36xx_smd_send_beacon(wcn, skb, tim_off, 0);
> +			skb = ieee80211_beacon_get_tim(hw, vif, &tim_off,
> +						       &tim_len);
> +			if (skb) {
> +				wcn36xx_smd_send_beacon(wcn, skb, tim_off, 0);
> +				dev_kfree_skb(skb);
> +			} else
> +				wcn36xx_error("failed to alloc beacon skb");

If think it would be better to bail out from the function if skb is
null.

-- 
Kalle Valo



More information about the wcn36xx mailing list