Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3004296imm; Sun, 5 Aug 2018 18:21:58 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeZYHftrvBnZrHBvQSxGGhSvfrdlMhf/f13MhNCsEkNjSI+KxMM9Qtmsl/9icHlGvHsu7RU X-Received: by 2002:a62:4dc1:: with SMTP id a184-v6mr4728878pfb.5.1533518518403; Sun, 05 Aug 2018 18:21:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533518518; cv=none; d=google.com; s=arc-20160816; b=Z9FkXzdZ9MMZkLbvf4tbquJE8YNXqcgsBTUSML3pVxWarfYmY3K9jXoovpHxG4R6mU etH54x+h9wCAqLDGpibwjuCOJOCnFrAOWClgbFH9QyMc95jotQpZy/p4qgK2yUIUkNsD yUAnLrTEVnV+5A4yQkOJb25ij3oNgMTl3juVadhQyfYTmR8ljReBh9S1aVpDJDzpsR2r 5H/jgcWNN25RAXrqxyDV7ypKUHGIoCc1doQvpLIMLDmF5zZpLicsXCqPFprheUYV17Mo ey5LM62hyET7dCusdRfW5lAr5Zli2sML3TJi1xZhe9jJBVEn+O9lOAVKwPitL/C6hX+Z ySjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=IZlw2NWT+M/6tVKcxlKVDeqR92+e0qrBtYYomK+0/bw=; b=S4HWUaRYn8JKN9DrTZmQ7YD3POIDvYhKlK0xJegTwEZI4fpulobnbo14HKFNliPat8 iO6XUizCfl+z2k8eY0wF9/csFlJ/pfPVuhb0TZcNvdFts/UIlFKqXqoQuw5rG5w4m1q6 ikFzpady8cUELDVTvBLLLsV3XFGbu2mi6LorpcvDtbgjS21wxVpvj/5NK5kSGqMokM45 RE2aLHpjJfRPJIoBQFlWaE6NEeRCk6PXWzMN6Uc2v6z+avrWlZhM8UBd7t6DoZd53QLY /J4C84lUSLEVMUG7vtb0FmizhOT0s0Ofolk0WZ91pgIGXfIbYunaZGRjK1iFsyZOFlTC lc8w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h8-v6si11037368pgr.379.2018.08.05.18.21.43; Sun, 05 Aug 2018 18:21:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727522AbeHFD1d (ORCPT + 99 others); Sun, 5 Aug 2018 23:27:33 -0400 Received: from out1.zte.com.cn ([202.103.147.172]:49574 "EHLO mxct.zte.com.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726988AbeHFD1d (ORCPT ); Sun, 5 Aug 2018 23:27:33 -0400 Received: from mse01.zte.com.cn (unknown [10.30.3.20]) by Forcepoint Email with ESMTPS id CAC46D6F7818A062A773; Mon, 6 Aug 2018 09:20:53 +0800 (CST) Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id w761KiuS026262; Mon, 6 Aug 2018 09:20:44 +0800 (GMT-8) (envelope-from wang.yi59@zte.com.cn) Received: from fox-host8.localdomain ([10.74.120.8]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2018080609204539-3234299 ; Mon, 6 Aug 2018 09:20:45 +0800 From: Yi Wang To: tj@kernel.org Cc: jiangshanlai@gmail.com, linux-kernel@vger.kernel.org, jiang.biao2@zte.com.cn, wang.yi59@zte.com.cn, zhong.weidong@zte.com.cn Subject: [PATCH] workqueue: fix memory leak in wq_numa_init() Date: Mon, 6 Aug 2018 09:20:39 +0800 Message-Id: <1533518439-3982-1-git-send-email-wang.yi59@zte.com.cn> X-Mailer: git-send-email 1.8.3.1 X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2018-08-06 09:20:45, Serialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17, 2016) at 2018-08-06 09:20:44, Serialize complete at 2018-08-06 09:20:44 X-MAIL: mse01.zte.com.cn w761KiuS026262 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 */ return; } -- 1.8.3.1