Skip to contentSkip to conversation

neigh_table_clear() doesn't free stats

PATCH Applied Kirill Korotaev 2 participants 2 messages Sep 1, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

net/core/neighbour.c +0 -0
index 89b7904..a45bd21 100644
@@ -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;
}
maintainer Applied
#1 lore raw

From: Kirill Korotaev <[email protected]>
Date: Fri, 01 Sep 2006 12:28:56 +0400

Quoted 9 lines

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.

Applied, thanks a lot.