Search Linux Wireless

Re: [PATCH] mac80211: fix a memory leak on sta rate selection table

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 05/23/2014 10:29 AM, Felix Fietkau wrote:
> Cc: stable@xxxxxxxxxxxxxxx
> Reported-by: Christophe Prévotaux <cprevotaux@xxxxxxxxxx>
> Signed-off-by: Felix Fietkau <nbd@xxxxxxxxxxx>

Any idea how far back this should be applied?

Thanks,
Ben

> ---
>  net/mac80211/sta_info.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
> index 632d372..8b42f49 100644
> --- a/net/mac80211/sta_info.c
> +++ b/net/mac80211/sta_info.c
> @@ -227,6 +227,7 @@ struct sta_info *sta_info_get_by_idx(struct ieee80211_sub_if_data *sdata,
>   */
>  void sta_info_free(struct ieee80211_local *local, struct sta_info *sta)
>  {
> +	struct ieee80211_sta_rates *rates;
>  	int i;
>  
>  	if (sta->rate_ctrl)
> @@ -238,6 +239,10 @@ void sta_info_free(struct ieee80211_local *local, struct sta_info *sta)
>  		kfree(sta->tx_lat);
>  	}
>  
> +	rates = rcu_dereference_protected(sta->sta.rates, true);
> +	if (rates)
> +		kfree(rates);
> +
>  	sta_dbg(sta->sdata, "Destroyed STA %pM\n", sta->sta.addr);
>  
>  	kfree(sta);
> 


-- 
Ben Greear <greearb@xxxxxxxxxxxxxxx>
Candela Technologies Inc  http://www.candelatech.com

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux