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 6BB3AC433EF for ; Thu, 12 May 2022 03:08:16 +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=Grs2zB7QoT2aJ1iBPJF+KJEiA8HZd4m/PxJmPiIShAE=; b=WUhmUppV99u7eX MP+oILaD64D95VqO0JaVj4owfApl3nhYcMrUdHGCxxwm8nMS0Wj3zljRWD4aqw6KonwGlxg7dO4+J GGMFZWRpuQ8EV4ITF+pGOv3BHPycyAsFU2lbt81f6mUovKmXj6WmhdJQcEorWi9lySA2dAorD97bW RTzgjzUp3G+6bDGf6+uX1HnWIyL+UaHk+/dCsKTnMDkLYB9b7wQiZ/g1wr6inVSXSgo5CU3bmnqmd rjOc61/WXgrqmK8O+VqdmDytFiPUKVY8Vnh41PGkqxIdu8uigsXigfNDKjZgnH+vWy+S+iTISknjY V5PKJ0nArSdA5E4Dza+A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nozAT-009d1R-Bb; Thu, 12 May 2022 03:07:09 +0000 Received: from szxga03-in.huawei.com ([45.249.212.189]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nozAO-009cy5-NM for linux-arm-kernel@lists.infradead.org; Thu, 12 May 2022 03:07:06 +0000 Received: from kwepemi500011.china.huawei.com (unknown [172.30.72.54]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4KzGlg64RZzCsb7; Thu, 12 May 2022 11:02:07 +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:06:55 +0800 Message-ID: <627C79CE.3070402@hisilicon.com> Date: Thu, 12 May 2022 11:06:54 +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: dggems705-chm.china.huawei.com (10.3.19.182) 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_200704_980268_5C512BB6 X-CRM114-Status: GOOD ( 12.71 ) 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); > } > } > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel