提交 bd9b448f 编写于 作者: P Pavel Emelyanov 提交者: John W. Linville

mac80211: Consolidate hash kfree-ing in mesh.c.

There are already two places, that kfree the mesh_table and
its buckets.
Signed-off-by: NPavel Emelyanov <xemul@openvz.org>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 a3538b19
...@@ -315,6 +315,13 @@ struct mesh_table *mesh_table_alloc(int size_order) ...@@ -315,6 +315,13 @@ struct mesh_table *mesh_table_alloc(int size_order)
return newtbl; 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) void mesh_table_free(struct mesh_table *tbl, bool free_leafs)
{ {
struct hlist_head *mesh_hash; struct hlist_head *mesh_hash;
...@@ -330,9 +337,7 @@ void mesh_table_free(struct mesh_table *tbl, bool free_leafs) ...@@ -330,9 +337,7 @@ void mesh_table_free(struct mesh_table *tbl, bool free_leafs)
} }
spin_unlock(&tbl->hashwlock[i]); spin_unlock(&tbl->hashwlock[i]);
} }
kfree(tbl->hash_buckets); __mesh_table_free(tbl);
kfree(tbl->hashwlock);
kfree(tbl);
} }
static void ieee80211_mesh_path_timer(unsigned long data) static void ieee80211_mesh_path_timer(unsigned long data)
...@@ -378,9 +383,7 @@ struct mesh_table *mesh_table_grow(struct mesh_table *tbl) ...@@ -378,9 +383,7 @@ struct mesh_table *mesh_table_grow(struct mesh_table *tbl)
hlist_for_each_safe(p, q, &newtbl->hash_buckets[i]) hlist_for_each_safe(p, q, &newtbl->hash_buckets[i])
tbl->free_node(p, 0); tbl->free_node(p, 0);
} }
kfree(newtbl->hash_buckets); __mesh_table_free(tbl);
kfree(newtbl->hashwlock);
kfree(newtbl);
endgrow: endgrow:
return NULL; return NULL;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册