Skip to content

Commit 3fcde74

Browse files
Kirill KorotaevDavid S. Miller
authored andcommitted
[NEIGH]: neigh_table_clear() doesn't free stats
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>
1 parent 803db24 commit 3fcde74

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

net/core/neighbour.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1432,6 +1432,9 @@ int neigh_table_clear(struct neigh_table *tbl)
14321432
kfree(tbl->phash_buckets);
14331433
tbl->phash_buckets = NULL;
14341434

1435+
free_percpu(tbl->stats);
1436+
tbl->stats = NULL;
1437+
14351438
return 0;
14361439
}
14371440

0 commit comments

Comments
 (0)