Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp586532iog; Mon, 13 Jun 2022 08:38:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw2byseO/kg2HxWr7yG2t6mAttUgcs3asmsIUPNzAu/Nnxes+YpcLPHH8XrxK1ZxwMZrbJz X-Received: by 2002:a63:b105:0:b0:3fd:a875:d16 with SMTP id r5-20020a63b105000000b003fda8750d16mr173002pgf.209.1655134697138; Mon, 13 Jun 2022 08:38:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655134697; cv=none; d=google.com; s=arc-20160816; b=L1QgA4cQqWuhc83wubwH6XwAt0+h4IBSxtB00pCKK/Wujfc1Rx1bVAAedpM6O4XJhn B6/BIF/iIqqP8/Ld8+ZwzQBJjLwzwCnGTuWdCf32qWXGMv6l1IWYxZrXGDaJ0b0TxKGk L3dFXed8JdpZshB6Dq0e/QOMPoHChxcHC+C/6EfdFX7grvfKrF4ofMW1iVGNekbp+lod cmWP4R4yLAF3+Qz9l3avoZQoo9chrKDD1erW+qYgi5KvRkDiBX0VMysG/uxJO08SnX4Z JSO63MS9RffTOzVeGQfZcxUejKF0Pvxk8heFLrbv3Ny1GJ3PEMQY0lEl/0xpxycxgbk6 ZGqw== 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=oCkoev1Gb7lQWWccSWb0jKl2InJfH13kBsceGoBd2TE=; b=qwkplHVqrKYF0X/vWa9SSD4zwD0lD/VrMPCE9atNR+at1pLzU+Mj4BvmaBFY8lqg1Z N1trUcKFe3oKQuKtuxbAZwAwZjz4GPfmRHdT/LTwo2ZCURGXkwVHMvhO1o7p0TCJ7wdl V8DWfdMg95GJw7WFyq1Bjr5elcPrC07Tt+u0TqkVwq2QLJNAuWOesnrmJqMP7sraiVHe pKVYMf0Wxg9YV7QNoy1v/nUTNBdqK62hhw0h0+zal/sgUWmQN1G4FvY6wNJThPg4GAs0 aoA3x2wKudr5V3LDJNmGImk7lYlc/dZ8bM0yJXgonSKPSv7eEDFh5kD01ORs2SsXaQn6 WHMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hNYrt8za; 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 x8-20020aa79a48000000b005188fc8f52asi9159241pfj.71.2022.06.13.08.38.03; Mon, 13 Jun 2022 08:38:17 -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=hNYrt8za; 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 S241905AbiFMKRd (ORCPT + 99 others); Mon, 13 Jun 2022 06:17:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241536AbiFMKRB (ORCPT ); Mon, 13 Jun 2022 06:17:01 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7D661FA4B; Mon, 13 Jun 2022 03:15:28 -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 ams.source.kernel.org (Postfix) with ESMTPS id E55F3B80E59; Mon, 13 Jun 2022 10:15:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 62901C3411F; Mon, 13 Jun 2022 10:15:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655115321; bh=zNPkcQOyShqLbV+xa1BwXlT08Aj8LMQ7Mr3OHGehq1E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hNYrt8zam162gbTMW3fjbwU6d9wmmFcoEEc94hOayr5nhWmp/k1v5k8A/Ekia3HrM ueKMG19SdulMSuYnMYE66Ozpm+rJTHsufDyJPjSEv/paTSPvKAf0A0Y/3vSShNjJ5y rZq0Ps/ujhb1EPq0nopYWeS4eBpYUeYB8YjVbDNQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peng Wu , Wei Xu , Sasha Levin Subject: [PATCH 4.9 032/167] ARM: hisi: Add missing of_node_put after of_find_compatible_node Date: Mon, 13 Jun 2022 12:08:26 +0200 Message-Id: <20220613094848.298800200@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220613094840.720778945@linuxfoundation.org> References: <20220613094840.720778945@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=-8.3 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: Peng Wu [ Upstream commit 9bc72e47d4630d58a840a66a869c56b29554cfe4 ] of_find_compatible_node will increment the refcount of the returned device_node. Calling of_node_put() to avoid the refcount leak Signed-off-by: Peng Wu Signed-off-by: Wei Xu Signed-off-by: Sasha Levin --- arch/arm/mach-hisi/platsmp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm/mach-hisi/platsmp.c b/arch/arm/mach-hisi/platsmp.c index e1d67648d5d0..fccceab33325 100644 --- a/arch/arm/mach-hisi/platsmp.c +++ b/arch/arm/mach-hisi/platsmp.c @@ -70,14 +70,17 @@ static void __init hi3xxx_smp_prepare_cpus(unsigned int max_cpus) } ctrl_base = of_iomap(np, 0); if (!ctrl_base) { + of_node_put(np); pr_err("failed to map address\n"); return; } if (of_property_read_u32(np, "smp-offset", &offset) < 0) { + of_node_put(np); pr_err("failed to find smp-offset property\n"); return; } ctrl_base += offset; + of_node_put(np); } } @@ -163,6 +166,7 @@ static int hip01_boot_secondary(unsigned int cpu, struct task_struct *idle) if (WARN_ON(!node)) return -1; ctrl_base = of_iomap(node, 0); + of_node_put(node); /* set the secondary core boot from DDR */ remap_reg_value = readl_relaxed(ctrl_base + REG_SC_CTRL); -- 2.35.1