From patchwork Sun Dec 18 14:10:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 34322 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp1942158wrn; Sun, 18 Dec 2022 06:27:44 -0800 (PST) X-Google-Smtp-Source: AMrXdXs5sF9r4l8lsPjO5y0FGplNt6koyas9+miWNlPXoKcydpOtdV8eaGnhr7mg10T2f+rGUCqy X-Received: by 2002:a17:903:22c8:b0:188:de22:324b with SMTP id y8-20020a17090322c800b00188de22324bmr7122227plg.6.1671373664376; Sun, 18 Dec 2022 06:27:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671373664; cv=none; d=google.com; s=arc-20160816; b=O7FaqWKHTwFC9+DXAolPfS/sFtWAo9YpBAEyTN6AhPiAeeJijTy2Srw7Az0lVjLFtW 35pYhJRjAgLEvB0Rb+2Oa51FmOdI20pvXAr1l017jEF/j2XPwwwqpE9/Z//i8HeQf3PN T82pKxCeCbSuZaoV8buKlhYcOBF46OzCrYhCY3iKCKaiROZ8bDC2gXuQ5bgg8kypZslU zwv02GQPY6Ces4bGad+eL/wR24otl6MlLgpO1UkNAz9zGkbQinoEE9YAIVz8/ek7o8AG S2vZsnsdYy7zMvpOux1mM92rPaMoJlaIEfqLp6V7gRZv2mP9ecijixHKvWHpBozoY0cd NH2g== 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 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.27.27; Sun, 18 Dec 2022 06:27:44 -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 + 99 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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752562311782273217?= X-GMAIL-MSGID: =?utf-8?q?1752562311782273217?= 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);