* [PATCH] workqueue: fix memory leak in wq_numa_init()
@ 2018-08-06 1:20 Yi Wang
[not found] ` <201808201205500126227@zte.com.cn>
0 siblings, 1 reply; 2+ messages in thread
From: Yi Wang @ 2018-08-06 1:20 UTC (permalink / raw)
To: tj; +Cc: jiangshanlai, linux-kernel, jiang.biao2, wang.yi59, zhong.weidong
The 'tbl' variable may leak when return in function
wq_numa_init(), and this patch fixes this.
Signed-off-by: Yi Wang <wang.yi59@zte.com.cn>
Reviewed-by: Jiang Biao <jiang.biao2@zte.com.cn>
---
kernel/workqueue.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 78b1920..9321a05 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -5649,6 +5649,7 @@ static void __init wq_numa_init(void)
node = cpu_to_node(cpu);
if (WARN_ON(node == NUMA_NO_NODE)) {
pr_warn("workqueue: NUMA node mapping not available for cpu%d, disabling NUMA support\n", cpu);
+ kfree(tbl);
/* happens iff arch is bonkers, let's just proceed */
return;
}
--
1.8.3.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] workqueue: fix memory leak in wq_numa_init()
[not found] ` <201808201205500126227@zte.com.cn>
@ 2018-08-20 16:00 ` Tejun Heo
0 siblings, 0 replies; 2+ messages in thread
From: Tejun Heo @ 2018-08-20 16:00 UTC (permalink / raw)
To: wang.yi59; +Cc: jiangshanlai, linux-kernel, jiang.biao2, zhong.weidong
On Mon, Aug 20, 2018 at 12:05:50PM +0800, wang.yi59@zte.com.cn wrote:
> Gentle ping :)
>
> > The 'tbl' variable may leak when return in function
> > wq_numa_init(), and this patch fixes this.
> >
> > Signed-off-by: Yi Wang <wang.yi59@zte.com.cn>
> > Reviewed-by: Jiang Biao <jiang.biao2@zte.com.cn>
It's a kernel bug path where we might as well crash. Whether the tbl
gets leaked or not doesn't matter.
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-08-20 16:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-06 1:20 [PATCH] workqueue: fix memory leak in wq_numa_init() Yi Wang
[not found] ` <201808201205500126227@zte.com.cn>
2018-08-20 16:00 ` Tejun Heo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).