Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp1445280pxy; Fri, 23 Apr 2021 08:13:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyOGrySR3mZgDIVcoKLTKowDYoZD73abPVLIV06tRLtQhQXiKrnFmXlGSkewFsvcYazYaOW X-Received: by 2002:a17:906:6ce:: with SMTP id v14mr4673253ejb.296.1619190801534; Fri, 23 Apr 2021 08:13:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619190801; cv=none; d=google.com; s=arc-20160816; b=dqYlvBL3g29hS78JEiBbBnRiNmyQ+N/mWQfpKX2mjVhObSijuDRGzVe1os142Hud9r kD666xMXNzWllyTosYqURQcx927mtiC4s2Ru2SHXLQbMyFTdBJvkRfWndvCrW+LG28v5 ZwvuObV3fTd3OVahihYJzu9NeXuH9/DHdP416rZ1lnX2hFi7uvw6LWjrawQ+QVuvv1Um S/DgZY8ndIarrFgCvwOayt7eGaN699SvkHcvJ5Rf4b2Tu51dlf0WsrHnylszwpNaRhRh M1xHrzO4zIebER40nakgm2gz/r/Qi+0PcxK+HqIRwdiCSpwOpjB2uFG9gvipFaCrDWdR BKYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=RO3u8EU0qBBterOZbsbsHnhvGN6sXBmR6QpRlJ6eYjw=; b=vkiKXlYoKLKmag0gD/lFV4uZ26ygHgkdmwGL9CT+ZYbI9uP5FDuzB7Dn9uXvq7SgCy USyThW9BzGDfjY6ipUJaPfi3ByTD7YAVk/O3UdigeqmmM8JDDMkcHfsnMgOpQfFBsc0G q4P9XW2K8pLep/zfiv/jHijUzQ1uDLrhtdI137CzzCyVsLlxMi2LHHlXR3RkWjdXGhLR pH02U4ayJ2xqguQZfYNpmVaeZnrDl2aZEJ6N/kcWFi4RGtUq0PQNN3+xXo2XWP6H8/iN x1n0UWnKMkEnLvPccFB5oc/orE5dLRoaWf1C3uCwKy/GBTPgL45ZVj9DIMut8kfD+HMx GAgw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r8si5478313eji.580.2021.04.23.08.12.57; Fri, 23 Apr 2021 08:13:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232365AbhDWPKP (ORCPT + 99 others); Fri, 23 Apr 2021 11:10:15 -0400 Received: from smtp04.smtpout.orange.fr ([80.12.242.126]:20479 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230416AbhDWPKJ (ORCPT ); Fri, 23 Apr 2021 11:10:09 -0400 Received: from localhost.localdomain ([86.243.172.93]) by mwinf5d51 with ME id wF9W2400q21Fzsu03F9X4c; Fri, 23 Apr 2021 17:09:32 +0200 X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Fri, 23 Apr 2021 17:09:32 +0200 X-ME-IP: 86.243.172.93 From: Christophe JAILLET To: jonas@southpole.se, stefan.kristiansson@saunalahti.fi, shorne@gmail.com, rppt@kernel.org, akpm@linux-foundation.org, arnd@arndb.de Cc: openrisc@lists.librecores.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH] openrisc: Fix a memory leak Date: Fri, 23 Apr 2021 17:09:28 +0200 Message-Id: X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 'setup_find_cpu_node()' take a reference on the node it returns. This reference must be decremented when not needed anymore, or there will be a leak. Add the missing 'of_node_put(cpu)'. Note that 'setup_cpuinfo()' that also calls this function already has a correct 'of_node_put(cpu)' at its end. Fixes: 9d02a4283e9c ("OpenRISC: Boot code") Signed-off-by: Christophe JAILLET --- arch/openrisc/kernel/setup.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/openrisc/kernel/setup.c b/arch/openrisc/kernel/setup.c index 2416a9f91533..c6f9e7b9f7cb 100644 --- a/arch/openrisc/kernel/setup.c +++ b/arch/openrisc/kernel/setup.c @@ -278,6 +278,8 @@ void calibrate_delay(void) pr_cont("%lu.%02lu BogoMIPS (lpj=%lu)\n", loops_per_jiffy / (500000 / HZ), (loops_per_jiffy / (5000 / HZ)) % 100, loops_per_jiffy); + + of_node_put(cpu); } void __init setup_arch(char **cmdline_p) -- 2.27.0