lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Wed, 07 May 2008 20:24:54 +0400
From:	Pavel Emelyanov <xemul@...nvz.org>
To:	Michael Buesch <mb@...sch.de>
CC:	Johannes Berg <johannes@...solutions.net>,
	"John W. Linville" <linville@...driver.com>,
	linux-wireless@...r.kernel.org,
	Linux Netdev List <netdev@...r.kernel.org>
Subject: Re: [PATCH 7/7][MAC80211]: Consolidate hash kfree-ing in mesh.c.

Michael Buesch wrote:
> On Wednesday 07 May 2008 17:57:11 Pavel Emelyanov wrote:
>> There are already two places, that kfree the mesh_table and
>> its buckets.
>>
>> Signed-off-by: Pavel Emelyanov <xemul@...nvz.org>
>>
>> ---
>>  net/mac80211/mesh.c |   15 +++++++++------
>>  1 files changed, 9 insertions(+), 6 deletions(-)
>>
>> diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
>> index f46fbdb..876ec18 100644
>> --- a/net/mac80211/mesh.c
>> +++ b/net/mac80211/mesh.c
>> @@ -315,6 +315,13 @@ struct mesh_table *mesh_table_alloc(int size_order)
>>  	return newtbl;
>>  }
>>  
>> +static void __mesh_table_free(struct mesh_table *tbl)
> 
> Why is this __double_underscored?

To show, that this one is to be used "with care", i.e. - with all
entries previously flushed.

>> +{
>> +	kfree(tbl->hash_buckets);
>> +	kfree(tbl->hashwlock);
>> +	kfree(tbl);
>> +}
>> +
>>  void mesh_table_free(struct mesh_table *tbl, bool free_leafs)
>>  {
>>  	struct hlist_head *mesh_hash;
>> @@ -330,9 +337,7 @@ void mesh_table_free(struct mesh_table *tbl, bool free_leafs)
>>  		}
>>  		spin_unlock(&tbl->hashwlock[i]);
>>  	}
>> -	kfree(tbl->hash_buckets);
>> -	kfree(tbl->hashwlock);
>> -	kfree(tbl);
>> +	__mesh_table_free(tbl);
>>  }
>>  
>>  static void ieee80211_mesh_path_timer(unsigned long data)
>> @@ -378,9 +383,7 @@ errcopy:
>>  		hlist_for_each_safe(p, q, &newtbl->hash_buckets[i])
>>  			tbl->free_node(p, 0);
>>  	}
>> -	kfree(newtbl->hash_buckets);
>> -	kfree(newtbl->hashwlock);
>> -	kfree(newtbl);
>> +	__mesh_table_free(tbl);
>>  endgrow:
>>  	return NULL;
>>  }
> 
> 
> 

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ