Message ID | 20230301185209.274134-4-jjhiblot@traphandler.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp3950817wrd; Wed, 1 Mar 2023 16:28:53 -0800 (PST) X-Google-Smtp-Source: AK7set+JpZ9yrp0mF45/2oAd8ehv9BHkul3+TsKvg+3u7T163rWoQGgkyz9EX3m1WKbIy+/DVBAe X-Received: by 2002:a17:907:c68a:b0:888:b471:8e46 with SMTP id ue10-20020a170907c68a00b00888b4718e46mr9296293ejc.50.1677716933647; Wed, 01 Mar 2023 16:28:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677716933; cv=none; d=google.com; s=arc-20160816; b=qZiktuIYW8K0sUSYjNzOe5HNNAWzGWELzAondbMCi8ehLlgWFDRFu5bpjiqoF20Jq1 pD/zeEtQsrdWaqAmEPs/z3PGEiZWanzjq7FExHAHUlgZ6QcQCxUlX47PM8KzdHEsi7NJ 42KZlfXISnZ9KfC42p98JfrFHYZyplAJwtfgQ02nJvg2QRL8FZXp7C9iDo4mp8erdNf4 WR/t0D68zpruysvju5fyC9naQCPd13GDGd62nUp6XhlK7OD5/iBVw5k2szVBlEAUf+ST FK9j91BaXuTaHTg3uKEBCey9guLEXESWO+yfs8atNaeRTQYWook1sTmOoKNR4Gdkduvv 1/hg== 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=pr7sIP1e2J+j7IoWlU/pgXJvBlTIJ0ONW4UXO0dTaVw=; b=eWDXQDWqgxFqcrEktYf1LKXgO68T2ypNjnZ/anQ7U2LoL/IGLfFd0zHH7GNW1o8n7k 2LUwmfMdkFBuaM+LJI18k7XFvadR4w6+sW5LBKtEyyoCsOJqQCkgmyqo3YXtbab4F6b8 733yLnP+785wQfV35q00cF+dLDhb2coSS/tyse8vMyFUp6o+QoMu5CuP4wD5Mpp0gqxA 6WJTi1EcclNvwFAf182EJyKbRJIvG7AF/cVzEVgnqgU8gqS/PwQjqheeTPrE8+rLhqGN +PJBFvhlYdT2SDBRHvzmB3H81SET1wnj5gbP9b7U9PxHjSBTSW7d/ZsD4IQxygH7xew4 aEow== 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 j17-20020a170906279100b008de4a641fe9si16409352ejc.659.2023.03.01.16.28.30; Wed, 01 Mar 2023 16:28:53 -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 S229815AbjCBAN5 (ORCPT <rfc822;davidbtadokoro@gmail.com> + 99 others); Wed, 1 Mar 2023 19:13:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229567AbjCBANz (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 1 Mar 2023 19:13:55 -0500 Received: from smtpout1.mo528.mail-out.ovh.net (smtpout1.mo528.mail-out.ovh.net [46.105.34.251]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5486A1E2B8; Wed, 1 Mar 2023 16:13:50 -0800 (PST) Received: from pro2.mail.ovh.net (unknown [10.109.156.120]) by mo528.mail-out.ovh.net (Postfix) with ESMTPS id BF7E021936; Wed, 1 Mar 2023 18:53:00 +0000 (UTC) Received: from localhost.localdomain (88.161.25.233) by DAG1EX1.emp2.local (172.16.2.1) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Wed, 1 Mar 2023 19:52:59 +0100 From: Jean-Jacques Hiblot <jjhiblot@traphandler.com> To: <saravanak@google.com>, <clement.leger@bootlin.com>, Geert Uytterhoeven <geert+renesas@glider.be>, Magnus Damm <magnus.damm@gmail.com>, Russell King <linux@armlinux.org.uk>, Michael Ellerman <mpe@ellerman.id.au>, Nicholas Piggin <npiggin@gmail.com>, Christophe Leroy <christophe.leroy@csgroup.eu>, <zajec5@gmail.com>, Daniel Lezcano <daniel.lezcano@linaro.org>, Thomas Gleixner <tglx@linutronix.de>, Claudiu Beznea <claudiu.beznea@microchip.com>, Marc Zyngier <maz@kernel.org>, <afaerber@suse.de>, Manivannan Sadhasivam <mani@kernel.org>, Palmer Dabbelt <palmer@dabbelt.com>, Paul Walmsley <paul.walmsley@sifive.com>, Chen-Yu Tsai <wens@csie.org>, Jernej Skrabec <jernej.skrabec@gmail.com>, Samuel Holland <samuel@sholland.org>, Rob Herring <robh+dt@kernel.org>, Frank Rowand <frowand.list@gmail.com>, Bjorn Helgaas <bhelgaas@google.com>, Nishanth Menon <nm@ti.com>, <ssantosh@kernel.org>, <mathias.nyman@intel.com>, <gregkh@linuxfoundation.org>, <thierry.reding@gmail.com>, <jonathanh@nvidia.com> CC: <linux-renesas-soc@vger.kernel.org>, <linux-arm-kernel@lists.infradead.org>, <linux-kernel@vger.kernel.org>, <linuxppc-dev@lists.ozlabs.org>, <linux-wireless@vger.kernel.org>, <linux-actions@lists.infradead.org>, <linux-riscv@lists.infradead.org>, <linux-sunxi@lists.linux.dev>, <devicetree@vger.kernel.org>, <linux-pci@vger.kernel.org>, <linux-usb@vger.kernel.org>, <linux-tegra@vger.kernel.org>, Jean-Jacques Hiblot <jjhiblot@traphandler.com> Subject: [PATCH 3/3] of: irq: release the node after looking up for "interrupts-extended" Date: Wed, 1 Mar 2023 19:52:09 +0100 Message-ID: <20230301185209.274134-4-jjhiblot@traphandler.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230301185209.274134-1-jjhiblot@traphandler.com> References: <20230301185209.274134-1-jjhiblot@traphandler.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [88.161.25.233] X-ClientProxiedBy: DAG3EX2.emp2.local (172.16.2.22) To DAG1EX1.emp2.local (172.16.2.1) X-Ovh-Tracer-Id: 11460535155466975612 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvhedrudelhedguddutdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkffojghfggfgtghisehtkeertdertddtnecuhfhrohhmpeflvggrnhdqlfgrtghquhgvshcujfhisghlohhtuceojhhjhhhisghlohhtsehtrhgrphhhrghnughlvghrrdgtohhmqeenucggtffrrghtthgvrhhnpeduteevleevvefggfdvueffffejhfehheeuiedtgedtjeeghfehueduudegfeefueenucfkphepuddvjedrtddrtddruddpkeekrdduiedurddvhedrvdeffeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepoehjjhhhihgslhhothesthhrrghphhgrnhgulhgvrhdrtghomheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohepshgrrhgrvhgrnhgrkhesghhoohhglhgvrdgtohhmpdhnmhesthhirdgtohhmpdhsshgrnhhtohhshheskhgvrhhnvghlrdhorhhgpdhmrghthhhirghsrdhnhihmrghnsehinhhtvghlrdgtohhmpdhgrhgvghhkhheslhhinhhugihfohhunhgurghtihhonhdrohhrghdpthhhihgvrhhrhidrrhgvughinhhgsehgmhgrihhlrdgtohhmpdhjohhnrghthhgrnhhhsehnvhhiughirgdrtghomhdplhhinhhugi dqrhgvnhgvshgrshdqshhotgesvhhgvghrrdhkvghrnhgvlhdrohhrghdplhhinhhugidqrghrmhdqkhgvrhhnvghlsehlihhsthhsrdhinhhfrhgruggvrggurdhorhhgpdhlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdplhhinhhugihpphgtqdguvghvsehlihhsthhsrdhoiihlrggsshdrohhrghdplhhinhhugidqfihirhgvlhgvshhssehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhlihhnuhigqdgrtghtihhonhhssehlihhsthhsrdhinhhfrhgruggvrggurdhorhhgpdhlihhnuhigqdhrihhstghvsehlihhsthhsrdhinhhfrhgruggvrggurdhorhhgpdhlihhnuhigqdhsuhhngihisehlihhsthhsrdhlihhnuhigrdguvghvpdguvghvihgtvghtrhgvvgesvhhgvghrrdhkvghrnhgvlhdrohhrghdplhhinhhugidqphgtihesvhhgvghrrdhkvghrnhgvlhdrohhrghdplhhinhhugidquhhssgesvhhgvghrrdhkvghrnhgvlhdrohhrghdpsghhvghlghgrrghssehgohhoghhlvgdrtghomhdpfhhrohifrghnugdrlhhishhtsehgmhgrihhlrdgtohhmpdhrohgshhdoughtsehkvghrnhgvlhdrohhrghdpshgrmhhuvghlsehshhholhhlrghnugdrohhrghdptghlvghmvghnthdrlhgvghgvrhessghoohhtlhhinhdrtghomhdpghgvvghrthdorhgvnhgvshgrshesghhlihguvghrrdgsvgdpmhgrghhnuhhsrdgurghmmhesghhmrghilhdrtghomhdplhhinhhugiesrghrmhhlihhnuhigrdh orhhgrdhukhdpmhhpvgesvghllhgvrhhmrghnrdhiugdrrghupdhnphhighhgihhnsehgmhgrihhlrdgtohhmpdgthhhrihhsthhophhhvgdrlhgvrhhohiestghsghhrohhuphdrvghupdiirghjvggtheesghhmrghilhdrtghomhdplhhinhhugidqthgvghhrrgesvhhgvghrrdhkvghrnhgvlhdrohhrghdpuggrnhhivghlrdhlvgiitggrnhhosehlihhnrghrohdrohhrghdptghlrghuughiuhdrsggviihnvggrsehmihgtrhhotghhihhprdgtohhmpdhmrgiisehkvghrnhgvlhdrohhrghdprghfrggvrhgsvghrsehsuhhsvgdruggvpdhmrghniheskhgvrhhnvghlrdhorhhgpdhprghlmhgvrhesuggrsggsvghlthdrtghomhdpphgruhhlrdifrghlmhhslhgvhiesshhifhhivhgvrdgtohhmpdifvghnshestghsihgvrdhorhhgpdhjvghrnhgvjhdrshhkrhgrsggvtgesghhmrghilhdrtghomhdpthhglhigsehlihhnuhhtrhhonhhigidruggvpdfovfetjfhoshhtpehmohehvdekpdhmohguvgepshhmthhpohhuth X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,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?1759201231868469661?= X-GMAIL-MSGID: =?utf-8?q?1759213710925211801?= |
Series |
of: irq: Fixes refcount issues with of_irq_parse_one()/of_irq_parse_raw()
|
|
Commit Message
Jean-Jacques Hiblot
March 1, 2023, 6:52 p.m. UTC
When of_parse_phandle_with_args() succeeds, a get() is performed on
out_irq->np. And another get() is performed in of_irq_parse_raw(),
resulting in the refcount being incremented twice.
Fixing this by calling put() after of_irq_parse_raw().
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@traphandler.com>
---
drivers/of/irq.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/of/irq.c b/drivers/of/irq.c index 95da943fcf075..244f240bc4ac4 100644 --- a/drivers/of/irq.c +++ b/drivers/of/irq.c @@ -349,8 +349,12 @@ int of_irq_parse_one(struct device_node *device, int index, struct of_phandle_ar /* Try the new-style interrupts-extended first */ res = of_parse_phandle_with_args(device, "interrupts-extended", "#interrupt-cells", index, out_irq); - if (!res) - return of_irq_parse_raw(addr, out_irq); + if (!res) { + p = out_irq->np; + res = of_irq_parse_raw(addr, out_irq); + of_node_put(p); + return res; + } /* Look for the interrupt parent. */ p = of_irq_find_parent(device);