Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4821826iob; Mon, 9 May 2022 02:24:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwprFcN/AgOOCl2xwAcSr5YBrkORp6muUCQEYtemAsQXEqIBK9t7rnFNXVHQQePgpUUFZ2s X-Received: by 2002:a17:902:d2c9:b0:15e:b28d:8ad2 with SMTP id n9-20020a170902d2c900b0015eb28d8ad2mr15443634plc.94.1652088261606; Mon, 09 May 2022 02:24:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652088261; cv=none; d=google.com; s=arc-20160816; b=cyhsvdQ1C9HP52DZbDLEQcr77Bjdb43gzDQ/XZxJJ10dHWUDTXKqbZwL8voNRqgCWM qt7Q5tqc1080++vQTtSlGGUvZVMP7UKKOgDcUOQcBEb33wu1x9VInG4vYRbW3U/fjr0B Ogi4tE+w2rciuKt4UMDkHsK4qIJq1uGLCqttf7EGwY7gJ7P/QeVpF+ncZFnDAXEzEFKA 6LL9eg8PoUx4DL+DOpy2VFLtrwxaaAQ55xQtUf6I3bZrNYVf3tNSkkBWn4vQ5L54MiqT RUybMkSY9uVUF+T2bSH+fiEwkzYgzPOPp8M3YsHDBo24JbxXI2hx2LwwPDsHw/NkX2xc wCnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:references :subject:cc:to:mime-version:user-agent:from:date:message-id; bh=7W0uKmoUFN/8kftza+t71l8Dv0Mr95WLmxcbbHH4bWE=; b=CnXDNo3+lBT2YmcBQXykH8CroRDjuGUyxzt39JNiRSlfgpnMl2jKlrBhEHLzM4Jr2r uzFDervgt2ZgGI1gzXCxjESy9EN7vxTUMEpb47A6LfPzH4ai1aMlEJDXDG57HsDK9grO 2vOGQLOxXOhVogfTisycVER+KhUP+EizIvCK1cmM/dylFHsJiEEaAIRshBJdjJTXo8tv 26Fo/Fvk2YODJ8zMoI9WK+qDje/82T5TLGyJpQT/i2ZBi71nlUbciE5d7iqawJxRSQyR DqZMy3tiDIumQXu58aBmi80CozsUyPk/w5Fc6aCqITasSXjAZYbYB65u6pKcuRgZE/08 VciQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=hisilicon.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id v22-20020a636116000000b003ab243f2064si13409277pgb.556.2022.05.09.02.24.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 02:24:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=hisilicon.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0197C20D56D; Mon, 9 May 2022 02:14:51 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350318AbiEGI3W (ORCPT + 99 others); Sat, 7 May 2022 04:29:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1383686AbiEGI3R (ORCPT ); Sat, 7 May 2022 04:29:17 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E8881EF for ; Sat, 7 May 2022 01:25:29 -0700 (PDT) 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> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit 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-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE,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 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); >