Skip to content

Commit

Permalink
mac80211: Consolidate hash kfree-ing in mesh.c.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Pavel Emelyanov authored and John W. Linville committed May 22, 2008
1 parent a3538b1 commit bd9b448
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions net/mac80211/mesh.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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)
Expand Down Expand Up @@ -378,9 +383,7 @@ struct mesh_table *mesh_table_grow(struct mesh_table *tbl)
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;
}
Expand Down

0 comments on commit bd9b448

Please sign in to comment.