Search Linux Wireless

Re: [PATCH] mac80211: fix a memory leak where sta_info is not freed

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

 



On Sat, 2021-10-02 at 08:53 -0600, Ahmed Zaki wrote:
> 
> +++ b/net/mac80211/sta_info.c
> @@ -640,12 +640,14 @@ static int sta_info_insert_finish(struct sta_info *sta) __acquires(RCU)
>  
>  	/* check if STA exists already */
>  	if (sta_info_get_bss(sdata, sta->sta.addr)) {
> +		sta_info_free(local, sta);
>  		err = -EEXIST;
>  		goto out_err;
>  	}
>  
>  	sinfo = kzalloc(sizeof(struct station_info), GFP_KERNEL);
>  	if (!sinfo) {
> +		sta_info_free(local, sta);
>  		err = -ENOMEM;
>  		goto out_err;
>  	}

We already have a "out_drop_sta", that calls cleanup_single_sta(), so
shouldn't we just add a label there ("out_free_sta") just before
cleanup_single_sta() and then we don't need the extra call?

johannes



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

  Powered by Linux