[PATCH] neigh_table_clear() doesn't free stats

Subsystems: networking [general], the rest

STALE7319d

2 messages, 2 authors, 2006-09-01 · open the first message on its own page

[PATCH] neigh_table_clear() doesn't free stats

From: Kirill Korotaev <hidden>
Date: 2006-09-01 08:26:02

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 <redacted>

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;
 }
 

Re: [PATCH] neigh_table_clear() doesn't free stats

From: David Miller <davem@davemloft.net>
Date: 2006-09-01 08:34:35

From: Kirill Korotaev <redacted>
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 <redacted>
Applied, thanks a lot.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help