Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3164301imw; Mon, 11 Jul 2022 03:18:04 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sQ1sGDrVKRoKZvMDjH1NmeNOTHLcuTHRpZC9rNaN65k0Crm34hEmH1X7XKEm33IdA81w96 X-Received: by 2002:a05:6402:3326:b0:43a:902b:d335 with SMTP id e38-20020a056402332600b0043a902bd335mr23634301eda.412.1657534684327; Mon, 11 Jul 2022 03:18:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657534684; cv=none; d=google.com; s=arc-20160816; b=A2+ircR1DdcbbZ8z8sBoX04VNCfEKwKB/HTkEkQ6vtyxjVO615BWGfTH7Hb2FUZtVQ tWewcu+VF1Li7/XNlDMHizbajMJv06JmUQGn0imvvOKR4qdMx/VPGerK9n43ZzBxOgZV yrVHNabA2tJvvfzj0U6bOEL9phQQWoZHecZ2qKXYqeybIC2pRc84J7jpoERJgxg7O0gH t50GxJnfkj6GD/xxTmEvI35J2Idzc4bBdOmh9tmR0uVKF8WY7Fdyma24ZAC5psaiX0gZ /S0t53dQOhTw7WT6KTp+wzXwSHpv7W+1xDzQAqA4UP9RjRpNc3oGG9Fjye3qer8k2gsq kW5w== 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=O2T9aIM3j9fNmfvZ1btPpuhOLWrzlnnQYSspyaOC5zNo8HA8PtNtXMUPauACekQ5Tp knyaBXxeLSZIym21CnktirHnWhNcBNjQ5k+92taVB8u2qNNNYSlgIXAd/VVLdQuCjgfz 97QFxUZxN2j1XUtpXvuqw13Y9qB6uxZIBbWUeUpyRydMv7WvEwY5B7mscdPMReMRzEx0 jqTdUCnrCftp6BA7DQMPJSA58Y0nr10/Q8AaZ7LcJQmy7LhIq8a61/V9GZzNEVg3plrh Gop5LS6QBpfxlK9C5Y9QwzPFkewiZtp8kZcJtse1yxxb0KvYY93xAH2dXVgJV1VGKFOD bstQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VwsucE8d; 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 s24-20020a1709064d9800b007269e2c6bf2si8185600eju.794.2022.07.11.03.17.39; Mon, 11 Jul 2022 03:18:04 -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=VwsucE8d; 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 S229919AbiGKJUv (ORCPT + 99 others); Mon, 11 Jul 2022 05:20:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231879AbiGKJUW (ORCPT ); Mon, 11 Jul 2022 05:20:22 -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 769FE53D02; Mon, 11 Jul 2022 02:12:29 -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 6EBE36111F; Mon, 11 Jul 2022 09:12:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 77BB1C34115; Mon, 11 Jul 2022 09:12:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530745; bh=8xduzV9XPwv+MRJJNBuvjbGKAF/YIl6fxiUCeWx2Z4Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VwsucE8dsAEX23+J9Trjn/+G+ynXAReAt07NfPdMGivqF3SJLo2/0BsazdLEntg2D PfBZPoF5aHJQG82NGxeDu3AYerF/f/0O31rJwXf1zrF52APmOkcnIuUV+d2TRC9Bib O6+7YufUIPHRVZS75JwnHYTu/osHk3DKbgb9xv+Y= 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.10 25/55] ARM: meson: Fix refcount leak in meson_smp_prepare_cpus Date: Mon, 11 Jul 2022 11:07:13 +0200 Message-Id: <20220711090542.507811982@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090541.764895984@linuxfoundation.org> References: <20220711090541.764895984@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=ham 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