* [PATCH] neigh_table_clear() doesn't free stats
@ 2006-09-01 8:28 Kirill Korotaev
2006-09-01 8:34 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Kirill Korotaev @ 2006-09-01 8:28 UTC (permalink / raw)
To: David S. Miller, netdev, Alexey Kuznetsov, devel
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>
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 89b7904..a45bd21 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -1429,6 +1429,9 @@ int neigh_table_clear(struct neigh_table
kfree(tbl->phash_buckets);
tbl->phash_buckets = NULL;
+ free_percpu(tbl->stats);
+ tbl->stats = NULL;
+
return 0;
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] neigh_table_clear() doesn't free stats
2006-09-01 8:28 [PATCH] neigh_table_clear() doesn't free stats Kirill Korotaev
@ 2006-09-01 8:34 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2006-09-01 8:34 UTC (permalink / raw)
To: dev; +Cc: netdev, kuznet, devel
From: Kirill Korotaev <dev@openvz.org>
Date: Fri, 01 Sep 2006 12:28:56 +0400
> 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>
Applied, thanks a lot.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-09-01 8:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-01 8:28 [PATCH] neigh_table_clear() doesn't free stats Kirill Korotaev
2006-09-01 8:34 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).