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 B6590CCA472 for ; Wed, 1 Jun 2022 13:55:28 +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:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=tk/1wrCVjqMnqKNdRYazcHqqCxXdY2HGny7iCVUlxT4=; b=opgKLyiLij3bjH HOaTbThewILSIqrNekiyvagn5xSwRUjzvnlp9gT0k1bEfyVu06WB+N4SHyV6+7f+N0LQqkzfNpG7Q kKnzNGowVNo6yNGfa69kVRHdtiAneNBcV8C4Ph+jnbkgUGzmfZ8k24jnD7MZeLeosLEf8Eplpci2f l2ea8BFro/qCdx5wEHSFI3CQNtXBv8oxUIOE7CdZkjCUzWA5PvwUdDLLZoswUc3p224DkPTRx2eDO k9N1BbnfyTRl94u99Ho6uf+td0jT7d+9+3PE40hLg5tHOVFfMODxZXpoHpa3RzdBcc28evIrJfz+T eJm1+WHIsZkgOXTRXc1Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwOnX-00GOr1-Kx; Wed, 01 Jun 2022 13:54:07 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwOmk-00GOM6-5N for linux-arm-kernel@lists.infradead.org; Wed, 01 Jun 2022 13:53:20 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BC11B615C2; Wed, 1 Jun 2022 13:53:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 67EA7C3411D; Wed, 1 Jun 2022 13:53:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1654091597; bh=djdQ9S61mfxn5Qroahz8b0fLg9sK1orzkaSB+oH7BUw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=G9jDq0NRmz8iPrbfGWaJJHZMPY4on4+PkFSUxJAXytvlHCCOXQOKigcOFpwzH52lD dC1JTATlg/pl0MA781mh9RKtKiWO+3EB+RNC3dYPvGMGJfcom9ifxlMntZ8aec3pVG aAtA1+87FrchTu4p0k+uaa6sg8kEIpHgDoSdEdI/q5u1KgDHl1DuxmPiDIsI2wQfOE eiawcEIbg4EN4zuuz0hKCsmDj3F/HA7Ap8+gWAfRaL1jc4A1UoCu6SNRBTKYgVBXty NWDxutxh71oA9ICW3GII/SbD6I9VLBtITPNS2ywOpM4JGmL2451lh/yIQjm7wke3zo Xo1lbWre1y+CQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Peng Wu , Wei Xu , Sasha Levin , linux@armlinux.org.uk, linux-arm-kernel@lists.infradead.org Subject: [PATCH AUTOSEL 5.18 27/49] ARM: hisi: Add missing of_node_put after of_find_compatible_node Date: Wed, 1 Jun 2022 09:51:51 -0400 Message-Id: <20220601135214.2002647-27-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220601135214.2002647-1-sashal@kernel.org> References: <20220601135214.2002647-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220601_065318_286686_C8EE44E7 X-CRM114-Status: GOOD ( 13.51 ) 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 From: Peng Wu [ Upstream commit 9bc72e47d4630d58a840a66a869c56b29554cfe4 ] 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 Signed-off-by: Wei Xu Signed-off-by: Sasha Levin --- 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.35.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel