archive mirror
 help / color / mirror / Atom feed
From: Yi Wang <>
Subject: [PATCH] workqueue: fix memory leak in wq_numa_init()
Date: Mon, 6 Aug 2018 09:20:39 +0800	[thread overview]
Message-ID: <> (raw)

The 'tbl' variable may leak when return in function
wq_numa_init(), and this patch fixes this.

Signed-off-by: Yi Wang <>
Reviewed-by: Jiang Biao <>
 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 */

             reply	other threads:[~2018-08-06  1:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-06  1:20 Yi Wang [this message]
     [not found] ` <>
2018-08-20 16:00   ` Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \
    --subject='Re: [PATCH] workqueue: fix memory leak in wq_numa_init()' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).