From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 27209C47085 for ; Mon, 24 May 2021 15:53:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 09CEB613F7 for ; Mon, 24 May 2021 15:53:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235287AbhEXPzE (ORCPT ); Mon, 24 May 2021 11:55:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:33896 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233279AbhEXPqZ (ORCPT ); Mon, 24 May 2021 11:46:25 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4F99061474; Mon, 24 May 2021 15:36:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621870599; bh=xRDxPjz1/JDXns6zj7yVp2y8VRABqOmVzDY89jckC54=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZQN3490asOXk2IVKlEgahW9VWLi8GDwyUyxPSNHPz4FfFo3VMikROCkVC5w6I10uY OaRdk0J15Uoyd0k9zMdPaWgXiaiVqqBIxQj4NlyM2JCOUMbbZyOMY4ptolulmR/Y9c /simHmlePXMkBj/Sn0qOtVKHrmFnB2FpsUUfKwRI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe JAILLET , Stafford Horne , Sasha Levin Subject: [PATCH 5.4 02/71] openrisc: Fix a memory leak Date: Mon, 24 May 2021 17:25:08 +0200 Message-Id: <20210524152326.530698558@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524152326.447759938@linuxfoundation.org> References: <20210524152326.447759938@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christophe JAILLET [ Upstream commit c019d92457826bb7b2091c86f36adb5de08405f9 ] '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 Signed-off-by: Stafford Horne Signed-off-by: Sasha Levin --- 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 d668f5be3a99..ae104eb4becc 100644 --- a/arch/openrisc/kernel/setup.c +++ b/arch/openrisc/kernel/setup.c @@ -274,6 +274,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.30.2