OpenVZ Forum


Home » Mailing lists » Devel » [PATCH] neigh_table_clear() doesn't free stats
[PATCH] neigh_table_clear() doesn't free stats [message #5834] Fri, 01 September 2006 08:26 Go to next message
Kirill Korotaev is currently offline  Kirill Korotaev
Messages: 137
Registered: January 2006
Senior Member
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;
}
Re: [PATCH] neigh_table_clear() doesn't free stats [message #5835 is a reply to message #5834] Fri, 01 September 2006 08:34 Go to previous message
davem is currently offline  davem
Messages: 463
Registered: February 2006
Senior Member
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.
Previous Topic: Re: wiki page (was Re: [PATCH] kthread: saa7134-tvaudio.c)
Next Topic: [PATCH] BC: resource beancounters (v3)
Goto Forum:
  


Current Time: Sat Jun 15 11:20:04 GMT 2024

Total time taken to generate the page: 0.03686 seconds