Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3180497imw; Mon, 11 Jul 2022 03:42:18 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uN4JUCnyaJN5//E2vXH67eozTFrn1AODROJZQW0FtEfLKqsZ5O3QI/A2QNJOEfFbdS6H+r X-Received: by 2002:a17:907:7b9c:b0:72b:5652:a14a with SMTP id ne28-20020a1709077b9c00b0072b5652a14amr4183548ejc.86.1657536138359; Mon, 11 Jul 2022 03:42:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657536138; cv=none; d=google.com; s=arc-20160816; b=VgPsm6A4NxxHrqVp/yyNbq1i0gUVLeaTS3P6ucVwkz5GJvDjluUndPbq0XmTI2wrfP 7cdThHd3szo4JQn7pt1QUe5fS+r1Av/fVjiA5cHUSOFGCfMgOA0sFixw6FAHDkfd114j h85w/VbOiY5K+eijBXGi7MUz8s1N44j5p00Wn+3qpkiz8fknTrRVPyZjhmSqhuIMHsdw Au+WAf/O5GbbjZnuC65GFSzH/4gqeyejIdMl2rTkRO/jV+qb9CZzf9pTLyHSL7iltdZs Hmzf4e655mivmNxyXU4JuORxm3Zr7qGOzBAx1mXz/t6TW+pIe/o6rs122N9rAY2Dvdsc gHFQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=tsnlgsaX4HMmXU/ZISN2LmZqFNzpErmad1bcDFL1TlI=; b=S2Is0XbTCTQANV9TSkX3x9M4uN6RnocbI6fDHM7LI13CBnW1t4TRuwIBA7njTChKRK +lMWe0oVDUNTigSll31k4PyTCGhj+ahJa4qGxN0bVBNFuADWbaiZqiQp+gO/qGzJG9Ah B/ktdbDsKAIDd7UIfgCM5UnMc3nOa9cdXnYBqJrbQp272kGEKl3nOonkgCtcKLhfWvWN 1sfCx/wILsv0jzlTBFHKCbHtoviRpxCn0VKBBPYbEwBpWUN66FrD88n/1yQM+6gm+Amx AG4tfYrbnKStpyc6rmwt9gUglswNJHNoMaKJKe2M1qawQD8XGmt8YG5+EMgO2zRY2aqm ZXvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="2T/QQqn2"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hv11-20020a17090760cb00b0072b3a316cc6si10234602ejc.977.2022.07.11.03.41.53; Mon, 11 Jul 2022 03:42:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="2T/QQqn2"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233968AbiGKKDn (ORCPT + 99 others); Mon, 11 Jul 2022 06:03:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234480AbiGKKC5 (ORCPT ); Mon, 11 Jul 2022 06:02:57 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 065AF65D50; Mon, 11 Jul 2022 02:29:00 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7A7B461360; Mon, 11 Jul 2022 09:29:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 82034C34115; Mon, 11 Jul 2022 09:28:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657531739; bh=8xduzV9XPwv+MRJJNBuvjbGKAF/YIl6fxiUCeWx2Z4Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2T/QQqn2JMftqnj47FCpOccdiTVDzmEoKQWrjBD3giGki3mBi5+KgW3hyDwfIaSiP 7VTdNBJlEs1tzU9F3EB+xTn15v9RXHkhi48wwwVg/xsZvAjGswUarmYPJRuYQ2wp5g EgPow6TmEIzTOVzTxl0TSM14ngDTKWVhHxrsdLTw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Martin Blumenstingl , Neil Armstrong , Sasha Levin Subject: [PATCH 5.15 177/230] ARM: meson: Fix refcount leak in meson_smp_prepare_cpus Date: Mon, 11 Jul 2022 11:07:13 +0200 Message-Id: <20220711090609.134134578@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090604.055883544@linuxfoundation.org> References: <20220711090604.055883544@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Miaoqian Lin [ Upstream commit 34d2cd3fccced12b958b8848e3eff0ee4296764c ] of_find_compatible_node() returns a node pointer with refcount incremented, we should use of_node_put() on it when done. Add missing of_node_put() to avoid refcount leak. Fixes: d850f3e5d296 ("ARM: meson: Add SMP bringup code for Meson8 and Meson8b") Signed-off-by: Miaoqian Lin Reviewed-by: Martin Blumenstingl Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20220512021611.47921-1-linmq006@gmail.com Signed-off-by: Sasha Levin --- arch/arm/mach-meson/platsmp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/mach-meson/platsmp.c b/arch/arm/mach-meson/platsmp.c index 4b8ad728bb42..32ac60b89fdc 100644 --- a/arch/arm/mach-meson/platsmp.c +++ b/arch/arm/mach-meson/platsmp.c @@ -71,6 +71,7 @@ static void __init meson_smp_prepare_cpus(const char *scu_compatible, } sram_base = of_iomap(node, 0); + of_node_put(node); if (!sram_base) { pr_err("Couldn't map SRAM registers\n"); return; @@ -91,6 +92,7 @@ static void __init meson_smp_prepare_cpus(const char *scu_compatible, } scu_base = of_iomap(node, 0); + of_node_put(node); if (!scu_base) { pr_err("Couldn't map SCU registers\n"); return; -- 2.35.1