From patchwork Sun Dec 18 14:26:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 34323 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp1942825wrn; Sun, 18 Dec 2022 06:29:48 -0800 (PST) X-Google-Smtp-Source: AA0mqf5HF310AjpwbH66WQ6qu88oPhULiX9OXwWq5fTMCcTR+qNKKX0E/TP7KCcIrP//H6z1Ot9c X-Received: by 2002:a05:6a20:4b11:b0:ad:db18:6d0d with SMTP id fp17-20020a056a204b1100b000addb186d0dmr21201846pzb.59.1671373788461; Sun, 18 Dec 2022 06:29:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671373788; cv=none; d=google.com; s=arc-20160816; b=Twyo1TwhCNB9Hw9xqDuZK3OG03Up0lzUgImQyqjD5+2g0QApZOf5X/p7MQjHxYkBnz A6n99UT2omx0aOr8V0Iz7oFKA1DbG12/u4QgqN2d3XIuTJhdOwGwaf68vYj/Ia1sc/5a MCIJGjEQNcCtJtGhRnuzJ4Bcz/BrlXo5w0GEJQh335ZHsIXYMrNRd6zAQcI8AEKsrVCO DakPQXHV2gCosC3x6vdQOGTq5+Ei/9fHF4gHjoIssdTvgTdlJLV80o8REr93zQyO9bma LOu4aojUvQk4RVHQTSPDH5Mj7be8FX7unSWLJztDHoTeFYigU77AIQG/h4uwpLWaeFFX 3rUg== 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=Gsx2ZHnCLm3X0hL8Q297OFfXb7iI8e+E4t3VsK3Hg30=; b=npKPa35470s7UP3RO2qQQI80qQlGga0srk3SPoVdf/mhEdNTRk8GS8chWMeP2EfLLU BRnLXRr/FT3XAIRh/GH4V4PqFe3filXai6cjgm8kieybhHQXM6O7c6zb2raGGtS12l6x 8Ar1auGwOhiOSTXVUgXz0trXAArqRqPU3167C56kUVUfSShnjP+0ckIm6WCM1u03VK3O KqD8y0c2Yu0Zk3S6z4WmZRX1a689FPLxwTbW9ILiFrTtPyO96JyrZZ1F8ziA3XFg+Zry MnqqwYWVV8Yr+F/Y/2oqDzJlLbEiLojss9Rs+hPRbGVnyonuwkknF4Yv/ps6xZDh210x mm8w== 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 y12-20020a170902b48c00b00189788d1dedsi7342834plr.96.2022.12.18.06.29.21; Sun, 18 Dec 2022 06:29:48 -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 S230441AbiLRO1X (ORCPT + 99 others); Sun, 18 Dec 2022 09:27:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230131AbiLRO1R (ORCPT ); Sun, 18 Dec 2022 09:27:17 -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 ACDEA63CC for ; Sun, 18 Dec 2022 06:27:16 -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 1p6udF-0007F2-R8; Sun, 18 Dec 2022 15:27:13 +0100 From: Martin Kaiser To: Andre Przywara , Russell King Cc: Martin Kaiser , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] ARM: highbank: add missing of_node_put call Date: Sun, 18 Dec 2022 15:26:46 +0100 Message-Id: <20221218142647.394881-2-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 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?1752562441422091075?= X-GMAIL-MSGID: =?utf-8?q?1752562441422091075?= 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. Add a missing of_node_put call in function highbank_init. Signed-off-by: Martin Kaiser --- arch/arm/mach-highbank/highbank.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/mach-highbank/highbank.c b/arch/arm/mach-highbank/highbank.c index 5d4f977ac7d2..97ccb8c1b3cd 100644 --- a/arch/arm/mach-highbank/highbank.c +++ b/arch/arm/mach-highbank/highbank.c @@ -141,6 +141,7 @@ static void __init highbank_init(void) /* Map system registers */ np = of_find_compatible_node(NULL, NULL, "calxeda,hb-sregs"); sregs_base = of_iomap(np, 0); + of_node_put(np); WARN_ON(!sregs_base); pm_power_off = highbank_power_off; From patchwork Sun Dec 18 14:26:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 34324 Return-Path: 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 + 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 ); 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 ; 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 ) id 1p6udH-0007F2-Vr; Sun, 18 Dec 2022 15:27:16 +0100 From: Martin Kaiser To: Andre Przywara , Russell King Cc: Martin Kaiser , 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 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?1752562465134561386?= X-GMAIL-MSGID: =?utf-8?q?1752562465134561386?= 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 Reviewed-by: Andre Przywara --- 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); } static void highbank_power_off(void)