Skip to content

Commit

Permalink
[NEIGH]: neigh_table_clear() doesn't free stats
Browse files Browse the repository at this point in the history
neigh_table_clear() doesn't free tbl->stats.
Found by Alexey Kuznetsov. Though Alexey considers this
leak minor for mainstream, I still believe that cleanup
code should not forget to free some of the resources :)

At least, this is critical for OpenVZ with virtualized
neighbour tables.

Signed-Off-By: Kirill Korotaev <dev@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Kirill Korotaev authored and David S. Miller committed Sep 18, 2006
1 parent 803db24 commit 3fcde74
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/core/neighbour.c
Original file line number Diff line number Diff line change
Expand Up @@ -1432,6 +1432,9 @@ int neigh_table_clear(struct neigh_table *tbl)
kfree(tbl->phash_buckets);
tbl->phash_buckets = NULL;

free_percpu(tbl->stats);
tbl->stats = NULL;

return 0;
}

Expand Down

0 comments on commit 3fcde74

Please sign in to comment.