Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp746287iob; Thu, 28 Apr 2022 10:34:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwwuo0MfdWQXvMMg3Rw2m/oSBrAoQq/QsrsaY9a/kKtNXtHc433B7AVRfm6dJczrS0nvORY X-Received: by 2002:a2e:2c0f:0:b0:24f:13ab:efed with SMTP id s15-20020a2e2c0f000000b0024f13abefedmr13005365ljs.357.1651167297175; Thu, 28 Apr 2022 10:34:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651167297; cv=none; d=google.com; s=arc-20160816; b=IOFwjE586EETwv384J3NCrZnSkTP4Vm91dIj1R9sR7QZCho/TWdzmTBh2I2yDO63yB 2o4NPDckv06sYQiVz+IeHmqnDLQZIQ9oHtEZRfVf5L+gYHBQfYibcDvbuKDsktbyWu13 dP/wChuzvkiT7oQnDm53hA/ppp0oq0N0Y2fVibZchd0QuNM4P1xHykQI4aPLGfKcbhDA /SVnEVe76ooqVI3cIxKR7GW5qDuw1O1pVRvppuGp7O7qLXKcjzDcCcIyNit8chekfKpF s16fAucummOxX8dvE/kP4Y1NAPwyM0HTDpHFIYA/zKaGvWvvU+INmrvtB0sbCTteq4By EoSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=Gx6vugP4FcX7cB7ARs7mJ8ya06C2vBELkJIqWaunH/U=; b=vmKmYj4qKuvaXq+JFY6GKWliRVrK+WSLecyrDNII39KN81WLYBZrk5kfY+bKNMp5SP yr4neNUiXxaOPrvp7+Y06yoez65j6UUCf9K7GU+KzFO7J9K0yqB13EQ+tdCTSHUKYtzK y5DN/K/fteL2D02IECUdX/j64m2M2ljKV5w660Un+SxVPdygdtjzZK8q8OPW48sEEBGA LH9Mnw5zRjKxSwPscHt2nxNQc+RWeL+ciNSXsx6c/TQ33RHs2jXSiGrBarnh+LPBn7Ri ln8PN4QzAYZGIEGe+QVQ0JmLqMNxuQ/xG74n/KwLkVyQAxSEN05x3789exs5SnVvfUh2 +UNg== 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:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h8-20020a2e3a08000000b0024c7dee40b6si5025806lja.525.2022.04.28.10.34.28; Thu, 28 Apr 2022 10:34:57 -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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240061AbiD1Kui (ORCPT + 99 others); Thu, 28 Apr 2022 06:50:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229979AbiD1Kuh (ORCPT ); Thu, 28 Apr 2022 06:50:37 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8790089321 for ; Thu, 28 Apr 2022 03:47:21 -0700 (PDT) Received: from kwepemi500023.china.huawei.com (unknown [172.30.72.56]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4Kpsjr4F5mz1JBhm; Thu, 28 Apr 2022 18:46:24 +0800 (CST) Received: from huawei.com (10.175.112.208) by kwepemi500023.china.huawei.com (7.221.188.76) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 28 Apr 2022 18:47:19 +0800 From: Peng Wu To: , CC: , , , , Peng Wu Subject: [PATCH] ARM: hisi: Add missing of_node_put after of_find_compatible_node Date: Thu, 28 Apr 2022 10:43:06 +0000 Message-ID: <20220428104306.21682-1-wupeng58@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.112.208] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemi500023.china.huawei.com (7.221.188.76) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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 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 --- 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); -- 2.17.1