aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@openvz.org>2008-05-07 11:57:11 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-05-21 21:47:45 -0400
commitbd9b448f4c0a514559bdae4ca18ca3e8cd999c6d (patch)
tree090c74c16e3660e329d92f6435d28732401c1a5d /net
parenta3538b19a6d226f9d3d9b18865468370009dec55 (diff)
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 <xemul@openvz.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/mesh.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index cbce001f8f23..b5933b271491 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -315,6 +315,13 @@ struct mesh_table *mesh_table_alloc(int size_order)
315 return newtbl; 315 return newtbl;
316} 316}
317 317
318static void __mesh_table_free(struct mesh_table *tbl)
319{
320 kfree(tbl->hash_buckets);
321 kfree(tbl->hashwlock);
322 kfree(tbl);
323}
324
318void mesh_table_free(struct mesh_table *tbl, bool free_leafs) 325void mesh_table_free(struct mesh_table *tbl, bool free_leafs)
319{ 326{
320 struct hlist_head *mesh_hash; 327 struct hlist_head *mesh_hash;
@@ -330,9 +337,7 @@ void mesh_table_free(struct mesh_table *tbl, bool free_leafs)
330 } 337 }
331 spin_unlock(&tbl->hashwlock[i]); 338 spin_unlock(&tbl->hashwlock[i]);
332 } 339 }
333 kfree(tbl->hash_buckets); 340 __mesh_table_free(tbl);
334 kfree(tbl->hashwlock);
335 kfree(tbl);
336} 341}
337 342
338static void ieee80211_mesh_path_timer(unsigned long data) 343static void ieee80211_mesh_path_timer(unsigned long data)
@@ -378,9 +383,7 @@ errcopy:
378 hlist_for_each_safe(p, q, &newtbl->hash_buckets[i]) 383 hlist_for_each_safe(p, q, &newtbl->hash_buckets[i])
379 tbl->free_node(p, 0); 384 tbl->free_node(p, 0);
380 } 385 }
381 kfree(newtbl->hash_buckets); 386 __mesh_table_free(tbl);
382 kfree(newtbl->hashwlock);
383 kfree(newtbl);
384endgrow: 387endgrow:
385 return NULL; 388 return NULL;
386} 389}