Message ID | 20221218142647.394881-3-martin@kaiser.cx |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp1942973wrn; Sun, 18 Dec 2022 06:30:11 -0800 (PST) X-Google-Smtp-Source: AMrXdXtSdZdWHsjLOHd6jgu8Sg944RumFkPeVlltnQojmmNcQy3S3JDzDVy2JX1eHsiF+r4idUnV X-Received: by 2002:a05:6a20:c6cd:b0:b0:32f0:6237 with SMTP id gw13-20020a056a20c6cd00b000b032f06237mr1680377pzb.18.1671373811048; Sun, 18 Dec 2022 06:30:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671373811; cv=none; d=google.com; s=arc-20160816; b=VEJ+izIm0+IEmDIzczN733IxA3iY2zp253UGGVmeY8an6SdEwc33hzRZGOS+7cRrTu /2VQrUOwI4Cz60aeqzxjeIc9O1oE+8NxTgZlgNse1NINtWAymiC9GOpqYMmRRErIicD6 mbYW7NU9Pf9l+/07FaEvgJJfAcADIe0LJhqpAYGn6MSFMahuz+e1lRJSYwbOGB5YmUe9 KktCcirxVUHmz+MaOjPOTUJMqGwDhWA2mrJJhQWIjVd5ANPmkWccGWvzuITw6EiDRArT 5fKaqAY3/P30ifYMH1+7us9ZHN1NPApMMHHwCsaqa0f7EUkDDwUSdFxZPPMPuRKpc//5 d8DQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=So1j1hYqFXtJEFIACcVh9kSp0AmYmRqnPJx+iGopj2U=; b=VqpdprwUelEi6dH7rTFLXfGBVHk84etVXmqoq5x5XUGK5KRAhZt27TF1bIjz4MmkMk 0ql50bC/HMAtnTQ4PATAKcJGG4VydSMuoX6aizgtNTdVO/wecGJ9k2yh3hi6psIPXovt 2dtUgdT6+/rV16ey8GlEZ805/rsPESMBJ99N5rBJ1MSz7oFjj+9CGMLA9e433KWNcYDf 4p6R+bX0JcLZsUFl2y7XJWDlFpjUvi/PT9NCuFwFqEtGGqovElAZXlHhi75vj1p7xvbT gH2Z5BKwIXMP7emz/l6VCZUsqz5j25JW8Z429FY89u8U9F+xpM90Tsi7CU0mf+7y5T4E EL4g== 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 e6-20020a63e006000000b00462ed110adbsi8250447pgh.316.2022.12.18.06.29.57; Sun, 18 Dec 2022 06:30:11 -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 S230460AbiLRO10 (ORCPT <rfc822;peekingduck44@gmail.com> + 99 others); Sun, 18 Dec 2022 09:27:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230416AbiLRO1T (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 18 Dec 2022 09:27: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 2B9B07642 for <linux-kernel@vger.kernel.org>; Sun, 18 Dec 2022 06:27: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 <martin@kaiser.cx>) id 1p6udH-0007F2-Vr; Sun, 18 Dec 2022 15:27:16 +0100 From: Martin Kaiser <martin@kaiser.cx> To: Andre Przywara <andre.przywara@arm.com>, Russell King <linux@armlinux.org.uk> Cc: Martin Kaiser <martin@kaiser.cx>, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] ARM: highbank: fix of node handling in highbank_init_irq Date: Sun, 18 Dec 2022 15:26:47 +0100 Message-Id: <20221218142647.394881-3-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221218142647.394881-1-martin@kaiser.cx> References: <20221218142647.394881-1-martin@kaiser.cx> 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752562465134561386?= X-GMAIL-MSGID: =?utf-8?q?1752562465134561386?= |
Series |
ARM: highbank: add missing of_node_put calls
|
|
Commit Message
Martin Kaiser
Dec. 18, 2022, 2:26 p.m. UTC
highbank_init calls of_find_compatible_node and discards the returned
node. We should save the node and call of_node_put on it when finished.
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
arch/arm/mach-highbank/highbank.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
Comments
On Sun, 18 Dec 2022 15:26:47 +0100 Martin Kaiser <martin@kaiser.cx> wrote: Hi Martin, thanks for taking care of this. > highbank_init calls of_find_compatible_node and discards the returned > node. We should save the node and call of_node_put on it when finished. > > Signed-off-by: Martin Kaiser <martin@kaiser.cx> > --- > arch/arm/mach-highbank/highbank.c | 10 ++++++++-- > 1 file changed, 8 insertions(+), 2 deletions(-) > > diff --git a/arch/arm/mach-highbank/highbank.c b/arch/arm/mach-highbank/highbank.c > index 97ccb8c1b3cd..54eb1422ef8f 100644 > --- a/arch/arm/mach-highbank/highbank.c > +++ b/arch/arm/mach-highbank/highbank.c > @@ -50,10 +50,16 @@ static void highbank_l2c310_write_sec(unsigned long val, unsigned reg) > > static void __init highbank_init_irq(void) > { > + struct device_node *np; > + > irqchip_init(); > > - if (of_find_compatible_node(NULL, NULL, "arm,cortex-a9")) > - highbank_scu_map_io(); > + np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9"); > + if (!np) > + return; > + > + highbank_scu_map_io(); > + of_node_put(np); Technically the of_node_put() could happen even earlier, since we use the of_find_compatible_node() call only to figure out if this is the Cotex-A15 or the A9 part. But it doesn't really matter, and is correct anyways: Reviewed-by: Andre Przywara <andre.przywara@arm.com> I also quickly boot tested this on a Midway(A15), but don't have a Highbank(A9) readily set up at the moment. Cheers, Andre > } > > static void highbank_power_off(void)
diff --git a/arch/arm/mach-highbank/highbank.c b/arch/arm/mach-highbank/highbank.c index 97ccb8c1b3cd..54eb1422ef8f 100644 --- a/arch/arm/mach-highbank/highbank.c +++ b/arch/arm/mach-highbank/highbank.c @@ -50,10 +50,16 @@ static void highbank_l2c310_write_sec(unsigned long val, unsigned reg) static void __init highbank_init_irq(void) { + struct device_node *np; + irqchip_init(); - if (of_find_compatible_node(NULL, NULL, "arm,cortex-a9")) - highbank_scu_map_io(); + np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9"); + if (!np) + return; + + highbank_scu_map_io(); + of_node_put(np); } static void highbank_power_off(void)