From: Pavel Emelyanov Date: Wed, 7 May 2008 15:57:11 +0000 (+0400) Subject: mac80211: Consolidate hash kfree-ing in mesh.c. X-Git-Tag: v2.6.27-rc1~969^2~337^2~117 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bd9b448f4c0a514559bdae4ca18ca3e8cd999c6d;p=linux-2.6 mac80211: Consolidate hash kfree-ing in mesh.c. There are already two places, that kfree the mesh_table and its buckets. Signed-off-by: Pavel Emelyanov Signed-off-by: John W. Linville --- diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c index cbce001f8f..b5933b2714 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) +{ + 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; }