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 CE2C1C433F5 for ; Thu, 12 May 2022 03:10: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:To: MIME-Version:From:Date:Message-ID:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=v3xLZjCTAVqWSUAuh3bkm17fEaYfKcF4IvJDWgS8HeI=; b=MEzrlU+LOUbtxv Ck4MzKV1tkmCH/YJ6s6eRviVdjkk2cumJ5JmlJm/dNI7OTqWq3coT9hWEGwAoBD9ogZchDyletpWK HdIbLpJx7/PV5tENflxuJskM4AWyjo12drLwOxwuUAYAoE4l0DgrsXODlp+bpohIkRFHXY4uwG4JL VMb6K3Ps8smrewVCZRIRkzNOlYJtmzo2xNFHls2Q7pUFAVPcG7gUHy53bbwnm7hDPTfEE9nS+MnWP ClRAdMKqKOhndC1OORcC553VOAzGXLxruggEKEhmUEuXoXMlEE91iwWtuoC2YdStCEWG+Xc3Sti6L FW57wnCkrqySXdoXqTtA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nozCt-009dfb-Ib; Thu, 12 May 2022 03:09:39 +0000 Received: from szxga02-in.huawei.com ([45.249.212.188]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nozCp-009ddM-H9 for linux-arm-kernel@lists.infradead.org; Thu, 12 May 2022 03:09:37 +0000 Received: from kwepemi500011.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4KzGvN3PK9zhZ43; Thu, 12 May 2022 11:08:48 +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; Thu, 12 May 2022 11:09:28 +0800 Message-ID: <627C7A67.5020804@hisilicon.com> Date: Thu, 12 May 2022 11:09:27 +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: Miaoqian Lin , Russell King , Kevin Hilman , Haojian Zhuang , Zhangfei Gao , , , Subject: Re: [PATCH] ARM: hisi: Fix refcount leak in hi3xxx_smp_prepare_cpus References: <20220512025839.50333-1-linmq006@gmail.com> In-Reply-To: <20220512025839.50333-1-linmq006@gmail.com> X-Originating-IP: [10.67.102.125] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) 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-20220511_200935_812179_837A8EE8 X-CRM114-Status: GOOD ( 13.02 ) 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 Miaoqian, On 2022/5/12 10:58, Miaoqian Lin wrote: > 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: a9434e96d9f0 ("ARM: hi3xxx: add smp support") > Signed-off-by: Miaoqian Lin > --- > arch/arm/mach-hisi/platsmp.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/arch/arm/mach-hisi/platsmp.c b/arch/arm/mach-hisi/platsmp.c > index a56cc64deeb8..15e63b72df3a 100644 > --- a/arch/arm/mach-hisi/platsmp.c > +++ b/arch/arm/mach-hisi/platsmp.c > @@ -68,13 +68,16 @@ static void __init hi3xxx_smp_prepare_cpus(unsigned int max_cpus) > ctrl_base = of_iomap(np, 0); > if (!ctrl_base) { > pr_err("failed to map address\n"); > + of_node_put(np); > return; > } > if (of_property_read_u32(np, "smp-offset", &offset) < 0) { > pr_err("failed to find smp-offset property\n"); > + of_node_put(np); > return; > } > ctrl_base += offset; > + of_node_put(np); > } > } > > Thanks! But a similar patch[1] has been applied. [1]: https://www.spinics.net/lists/arm-kernel/msg975425.html Best Regards, Wei _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel