From patchwork Thu May 12 03:12:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaoqian Lin X-Patchwork-Id: 12846902 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 DEA57C433EF for ; Thu, 12 May 2022 03:14:19 +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: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:In-Reply-To:References: List-Owner; bh=ZvHe/mR5Z8mdk9U6/njqpepRdnjKSLMr3cM9526j5SU=; b=UuGIGUaOp7DGt5 OL5eP3BKOIDcgE1FWjK1POGgwCsL3yPz6KWIQ0g/yTSnR2j4SOvQxEdf25YL5ZIyYuWTVoDWR2r47 00Kgyv12Z7m9M/DWzunPtkm7T6xrSNudI3EKcFjqwJ1hvD5dUWZqI4I6nMMd5rg0PfDWV1kS6aMnK giIZdAbsyISwm4YrS8ITTxrbalS1A1UBuTCaEaVmkaIzLfI0bdNHRB1glAVtzrSKspKjgeiCRXvo9 D09Pg3aHsyz+jqlG+57QrOmzqXZZOkQI/PMmmpVJJ1CK/STUQxGbGTfdeldDbV5blR2pVM5k/DnXK ySi1qaIYZVqsFzYCSneA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nozGM-009eMO-D4; Thu, 12 May 2022 03:13:14 +0000 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nozGI-009eLJ-JW for linux-arm-kernel@lists.infradead.org; Thu, 12 May 2022 03:13:11 +0000 Received: by mail-pf1-x42e.google.com with SMTP id a11so3635175pff.1 for ; Wed, 11 May 2022 20:13:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=awueREtst5v5/t4VnngT5Elxk/Ya6/NhiGCRe0UTBoU=; b=jlaXssIcZdJBL4nrI4f5qoQkSPk4evc9Z3ZMYSIkANTEEWHFqoqBucZzb7zTzg+Sbw Npn/t+qQ9orb9TrIYBvIW6ktC6gWC58UAil4GjM6ijq1wgyeLem+IcX5ZfhnK5Ord2Nm RBvpKlI2p3dv0w320/gr2JnRxEtM9uVgGKa/gZh+UBajM0DOWMN7GRZ5q1/yS/6a2oTO IuB3jhPTO9kwGErXEKCyNo77Zj6v2Rmg6IGyGb2nqOS/Kr0mCGNtsiriPHE5tVR8bzB1 C0pdbMRtlFOM0jTX5cBL2lqvZXmVr4JrKrQP6NbxOi9VMkeid6aPSbQg0Ox+dOofqJHQ SZJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=awueREtst5v5/t4VnngT5Elxk/Ya6/NhiGCRe0UTBoU=; b=v/O2HT1qjemry/166cdhGIKyc8JBtaWSdmRkBtU4QpWSXibjsIaywyqfzu2METWxcU pEJrJku9hQJocZ29r0ciSM0cbWiWkywi98kIKXp2Dr6AkJlDpbsyttsfNRDqCGCBOZzp EW4Aju/V48ObItu7QzzNnpQhaXXeIt5gg+dT7927J0b/btUzpmbC4CSbz2hDWikqzYfY PYh8j9HmJNH7rsFEFtJCoTvONWKqz5PnTmq5BFY5I6g2aBR3wt0d+QCSTgglZr21ar3k RDMjjX0uKuxtBUDjpNgf8NqEHgj1Jy+EMYNkGzQN+pMhSkJwLeKPTuZLYPgnMPcZNwht y1/A== X-Gm-Message-State: AOAM530gr7b/+KHMQ7RXVh1cN3tAlNZ5oD079V1XCqClSpvjGFof11ka EqJNPRDOIe65O9BIWNEk1jM= X-Google-Smtp-Source: ABdhPJzVndRIBoKoHgahvtkJmW9JfoS1gBrPEX8MirlKdiUGx0ZJqb5z6p4F7ww7lgJcc6276Qmxbg== X-Received: by 2002:a63:6b04:0:b0:3db:33c:497a with SMTP id g4-20020a636b04000000b003db033c497amr7812515pgc.346.1652325188602; Wed, 11 May 2022 20:13:08 -0700 (PDT) Received: from localhost.localdomain ([202.120.234.246]) by smtp.googlemail.com with ESMTPSA id m2-20020a170902db0200b0015e8d4eb2bbsm2623000plx.261.2022.05.11.20.13.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 May 2022 20:13:08 -0700 (PDT) From: Miaoqian Lin To: Andre Przywara , Russell King , Rob Herring , Jamie Iles , Shawn Guo , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: linmq006@gmail.com Subject: [PATCH] ARM: highbank: Fix refcount leak in highbank_init Date: Thu, 12 May 2022 07:12:58 +0400 Message-Id: <20220512031259.56459-1-linmq006@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220511_201310_698149_FF84CBCF X-CRM114-Status: GOOD ( 11.87 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org of_find_compatible_node() returns a node pointer with refcount incremented, we should use of_node_put() on it when done. Add missing of_node_put() to avoid refcount leak. Fixes: 220e6cf7b793 ("ARM: add Highbank core platform support") Signed-off-by: Miaoqian Lin --- 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 db607955a7e4..af9488854fe3 100644 --- a/arch/arm/mach-highbank/highbank.c +++ b/arch/arm/mach-highbank/highbank.c @@ -142,6 +142,7 @@ static void __init highbank_init(void) np = of_find_compatible_node(NULL, NULL, "calxeda,hb-sregs"); sregs_base = of_iomap(np, 0); WARN_ON(!sregs_base); + of_node_put(np); pm_power_off = highbank_power_off; highbank_pm_init();