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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 25DC8C433EF for ; Sat, 7 May 2022 08:26:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:References:Subject:CC:To: MIME-Version:From:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=VLg448ridhNT6EQYZpPjE5kuCIaroIRKBmHQEScw3Ss=; b=MPZvtINi4PGEzd Oz3qy0ieY+WkXJ5LpYpCZPdatbSa6TgG4rdc7cs3zxFYdpqGSRWFn3MelnLPFXjNLquU3YWc/Ff3d PLmEsg9n9Ttl9y+bvbCMUDq2x/WOw988gQhh970eA0dGj+3j7K+qsz0TRDRu4djNzeBqXseK5p9iO HvtqyL8l1Z0KQ2HIVonBrXAQWqFK0wlP7D/ebY/V8lMzFKQIIWjY3vxzlfPFVltnN1XfMB0/zFJp8 l1Oit0jLz39DQzUHn8tyaAglBND2lI3sdgxKLxuYIuHAMXl2rwzkLOXd+v1GCbCaxdUgmcIVJBWyn sXQEdE8LeeJzvULpzEXA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nnFl8-006TxF-1v; Sat, 07 May 2022 08:25:50 +0000 Received: from szxga01-in.huawei.com ([45.249.212.187]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nnFl4-006TuF-JG for linux-arm-kernel@lists.infradead.org; Sat, 07 May 2022 08:25:48 +0000 Received: from kwepemi500011.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4KwL7m0MYszfbPL; Sat, 7 May 2022 16:24:20 +0800 (CST) Received: from [127.0.0.1] (10.67.102.125) by kwepemi500011.china.huawei.com (7.221.188.124) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Sat, 7 May 2022 16:25:26 +0800 Message-ID: <62762CF6.3010004@hisilicon.com> Date: Sat, 7 May 2022 16:25:26 +0800 From: Wei Xu User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Peng Wu , CC: , , , , Subject: Re: [PATCH] ARM: hisi: Add missing of_node_put after of_find_compatible_node References: <20220428104306.21682-1-wupeng58@huawei.com> In-Reply-To: <20220428104306.21682-1-wupeng58@huawei.com> X-Originating-IP: [10.67.102.125] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemi500011.china.huawei.com (7.221.188.124) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220507_012546_835061_E8C8EF9B X-CRM114-Status: GOOD ( 13.11 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Peng, On 2022/4/28 18:43, Peng Wu wrote: > 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 Thanks! Applied to the hisilicon armv7 SoC tree. Best Regards, Wei > --- > 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 a56cc64deeb8..9ce93e0b6cdc 100644 > --- a/arch/arm/mach-hisi/platsmp.c > +++ b/arch/arm/mach-hisi/platsmp.c > @@ -67,14 +67,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); > } > } > > @@ -160,6 +163,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); > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel