Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp1336358rwj; Sun, 18 Dec 2022 06:28:21 -0800 (PST) X-Google-Smtp-Source: AMrXdXvSeioEsAHBhEIEk5zSMb7O8XWXtkS+jsz4Z2Gx1/scKEzbgDQbORWmOlQ0sRiDcJmreodk X-Received: by 2002:a17:903:41c4:b0:189:ced9:a5ea with SMTP id u4-20020a17090341c400b00189ced9a5eamr7797149ple.27.1671373701037; Sun, 18 Dec 2022 06:28:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671373701; cv=none; d=google.com; s=arc-20160816; b=Ge7yMzWKnrOEdSecjYmRj9xrqHAdHRqnxMRt0ve89RJdw1I7kw2Vw3S2EMhw+HcR4B 5WkGuJ6xWCZ5dNntmibumMTzOKbUQ4Mj+WjLV8XYuVnYhz6ATZAHlNuYsUa8OhzKMdPd dNQDYjr8teBhLkSSGSZOyMVCW43LFUtMFXCBou0LgCSUoHHejs70XxMQNmhxLGd9qY+e hEm006TXnG2I0pTAhl/Qh9iKcHDTRDpkGG1TihNA6/BpbWuHn6QtXqvkD/tZ4KlouCAl +o3xrU7S7xveMGLs5v6cNkBWlP+B5PbEsDY2j25abF5PNTRxQBfME8jSe+xKM7dcaZ54 gBKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=9O5pR0K+7fK8G1VqKYK+ZfE8IAt5eohimnFD/+N4sqA=; b=k68k8Zl/Zq82p9yAfuhLOX3pm4GKDy/RE85J/CBpBUJIZK5+hyfxMnBP1Yq5+Q2poR TcpBBEJxv5IgOTlGcqbywMenSTF37h/1VJNetlxejjjXmbxPWOjsfRRx2w/iFjuB5Amc MixbA60KY6P2yfdZ8edOVeW3rE+tuGBGSaP+IuyOXl5iS11QRLV+BigGqmvUjQQDpKfD X31TU73gCkgqyk72JppQdpv4O0tWG0MQMaC3GtkjEf1QAObx6IQS9toqz3LJWQlk0T5n y4XhRQQsxiSkkVLWIKBnXU++tBa/r7j6LB7MEJxhCmVF2Mhl/39YW/9ff8HA3TVddfNO PsDQ== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k9-20020a170902d58900b00174f3a4935fsi7759950plh.249.2022.12.18.06.28.12; Sun, 18 Dec 2022 06:28:21 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230369AbiLROLV (ORCPT + 71 others); Sun, 18 Dec 2022 09:11:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230124AbiLROLT (ORCPT ); Sun, 18 Dec 2022 09:11:19 -0500 Received: from viti.kaiser.cx (viti.kaiser.cx [IPv6:2a01:238:43fe:e600:cd0c:bd4a:7a3:8e9f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F25960C3 for ; Sun, 18 Dec 2022 06:11:18 -0800 (PST) Received: from dslb-178-004-201-210.178.004.pools.vodafone-ip.de ([178.4.201.210] helo=martin-debian-2.paytec.ch) by viti.kaiser.cx with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1p6uNa-00077a-1g; Sun, 18 Dec 2022 15:11:02 +0100 From: Martin Kaiser To: Wei Xu , Russell King Cc: Martin Kaiser , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] ARM: hisi: add missing of_node_put calls Date: Sun, 18 Dec 2022 15:10:29 +0100 Message-Id: <20221218141028.394543-1-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE 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 A node that is returned by of_find_compatible_node has its refcount incremented. We have to call of_node_put when the node is no longer needed. For hip04_smp_init, the easiest option is to call of_node_put for all nodes at the end of the function. If we jump to the end of the function because of an error, unused local np... pointers are NULL by default and of_node_put(NULL) just returns. Signed-off-by: Martin Kaiser --- compile-tested only, I don't have this hardware arch/arm/mach-hisi/platmcpm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm/mach-hisi/platmcpm.c b/arch/arm/mach-hisi/platmcpm.c index 258586e31333..e4be6da07242 100644 --- a/arch/arm/mach-hisi/platmcpm.c +++ b/arch/arm/mach-hisi/platmcpm.c @@ -341,6 +341,9 @@ static int __init hip04_smp_init(void) err_reloc: memblock_phys_free(hip04_boot_method[0], hip04_boot_method[1]); err: + of_node_put(np); + of_node_put(np_sctl); + of_node_put(np_fab); return ret; } early_initcall(hip04_smp_init); -- 2.30.2