lkml.org 
[lkml]   [2014]   [Dec]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/5] workqueue: fix memory leak in wq_numa_init()
Date
wq_numa_init() will quit directly on some bonkers cases without freeing the
memory. Add the missing cleanup code.

Cc: Tejun Heo <tj@kernel.org>
Cc: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Cc: "Gu, Zheng" <guz.fnst@cn.fujitsu.com>
Cc: tangchen <tangchen@cn.fujitsu.com>
Cc: Hiroyuki KAMEZAWA <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
---
kernel/workqueue.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 09b685d..a6fd2b8 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -4811,6 +4811,9 @@ static void __init wq_numa_init(void)
if (WARN_ON(node == NUMA_NO_NODE)) {
pr_warn("workqueue: NUMA node mapping not available for cpu%d, disabling NUMA support\n", cpu);
/* happens iff arch is bonkers, let's just proceed */
+ for_each_node(node)
+ free_cpumask_var(tbl[node]);
+ kfree(tbl);
return;
}
cpumask_set_cpu(cpu, tbl[node]);
--
1.7.4.4


\
 
 \ /
  Last update: 2014-12-12 12:01    [W:0.260 / U:1.248 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site