浏览代码

[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>
Kirill Korotaev 18 年之前
父节点
当前提交
3fcde74b38
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      net/core/neighbour.c

+ 3 - 0
net/core/neighbour.c

@@ -1432,6 +1432,9 @@ int neigh_table_clear(struct neigh_table *tbl)
 	kfree(tbl->phash_buckets);
 	tbl->phash_buckets = NULL;
 
+	free_percpu(tbl->stats);
+	tbl->stats = NULL;
+
 	return 0;
 }