mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] PCI: rcar: Release temporary device tree node reference
@ 2026-09-24  1:04 Yuho Choi
  2026-09-24  6:51 ` Geert Uytterhoeven
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Yuho Choi @ 2026-09-24  1:04 UTC (permalink / raw)
  To: Marek Vasut, Manivannan Sadhasivam, Yoshihiro Shimoda
  Cc: Geert Uytterhoeven, Rob Herring, Bjorn Helgaas,
	Lorenzo Pieralisi, Krzysztof Wilczyński, linux-pci,
	linux-renesas-soc, linux-kernel, Yuho Choi

of_find_matching_node() returns a referenced node even when it is used
only as a boolean test. Drop the reference right after the match check.

Fixes: a115b1bd3af0 ("PCI: rcar: Add L1 link state fix into data abort hook")
Signed-off-by: Yuho Choi <oss.patchbox@gmail.com>
---
Changes in v2:
- Use an explicit of_node_put() instead of __free(device_node) (Marek Vasut)
- Switch to my oss.patchbox address

v1: https://lore.kernel.org/all/20260801233841.469826-1-dbgh9129@gmail.com/

 drivers/pci/controller/pcie-rcar-host.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/controller/pcie-rcar-host.c b/drivers/pci/controller/pcie-rcar-host.c
index cd9171eebc289..1f5e33c802b5b 100644
--- a/drivers/pci/controller/pcie-rcar-host.c
+++ b/drivers/pci/controller/pcie-rcar-host.c
@@ -1122,7 +1122,11 @@ static const struct of_device_id rcar_pcie_abort_handler_of_match[] __initconst
 
 static int __init rcar_pcie_init(void)
 {
-	if (of_find_matching_node(NULL, rcar_pcie_abort_handler_of_match)) {
+	struct device_node *np;
+
+	np = of_find_matching_node(NULL, rcar_pcie_abort_handler_of_match);
+	if (np) {
+		of_node_put(np);
 #ifdef CONFIG_ARM_LPAE
 		hook_fault_code(17, rcar_pcie_aarch32_abort_handler, SIGBUS, 0,
 				"asynchronous external abort");

base-commit: f0100363d8c374bd8e9ea7c9ba02744f0b802ca4
-- 
2.43.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] PCI: rcar: Release temporary device tree node reference
  2026-09-24  1:04 [PATCH v2] PCI: rcar: Release temporary device tree node reference Yuho Choi
@ 2026-09-24  6:51 ` Geert Uytterhoeven
  2026-09-25  4:31 ` Marek Vasut
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Geert Uytterhoeven @ 2026-09-24  6:51 UTC (permalink / raw)
  To: Yuho Choi
  Cc: Marek Vasut, Manivannan Sadhasivam, Yoshihiro Shimoda,
	Rob Herring, Bjorn Helgaas, Lorenzo Pieralisi,
	Krzysztof Wilczyński, linux-pci, linux-renesas-soc,
	linux-kernel

On Thu, 24 Sept 2026 at 03:04, Yuho Choi <oss.patchbox@gmail.com> wrote:
> of_find_matching_node() returns a referenced node even when it is used
> only as a boolean test. Drop the reference right after the match check.
>
> Fixes: a115b1bd3af0 ("PCI: rcar: Add L1 link state fix into data abort hook")
> Signed-off-by: Yuho Choi <oss.patchbox@gmail.com>
> ---
> Changes in v2:
> - Use an explicit of_node_put() instead of __free(device_node) (Marek Vasut)
> - Switch to my oss.patchbox address

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] PCI: rcar: Release temporary device tree node reference
  2026-09-24  1:04 [PATCH v2] PCI: rcar: Release temporary device tree node reference Yuho Choi
  2026-09-24  6:51 ` Geert Uytterhoeven
@ 2026-09-25  4:31 ` Marek Vasut
  2026-10-27 11:50 ` Manivannan Sadhasivam
  2026-11-04 17:55 ` Bjorn Helgaas
  3 siblings, 0 replies; 5+ messages in thread
From: Marek Vasut @ 2026-09-25  4:31 UTC (permalink / raw)
  To: Yuho Choi, Marek Vasut, Manivannan Sadhasivam, Yoshihiro Shimoda
  Cc: Geert Uytterhoeven, Rob Herring, Bjorn Helgaas,
	Lorenzo Pieralisi, Krzysztof Wilczyński, linux-pci,
	linux-renesas-soc, linux-kernel

On 9/24/26 3:04 AM, Yuho Choi wrote:
> of_find_matching_node() returns a referenced node even when it is used
> only as a boolean test. Drop the reference right after the match check.
> 
> Fixes: a115b1bd3af0 ("PCI: rcar: Add L1 link state fix into data abort hook")
> Signed-off-by: Yuho Choi <oss.patchbox@gmail.com>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>

Thank you !

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] PCI: rcar: Release temporary device tree node reference
  2026-09-24  1:04 [PATCH v2] PCI: rcar: Release temporary device tree node reference Yuho Choi
  2026-09-24  6:51 ` Geert Uytterhoeven
  2026-09-25  4:31 ` Marek Vasut
@ 2026-10-27 11:50 ` Manivannan Sadhasivam
  2026-11-04 17:55 ` Bjorn Helgaas
  3 siblings, 0 replies; 5+ messages in thread
From: Manivannan Sadhasivam @ 2026-10-27 11:50 UTC (permalink / raw)
  To: Marek Vasut, Yoshihiro Shimoda, Yuho Choi
  Cc: Geert Uytterhoeven, Rob Herring, Bjorn Helgaas,
	Lorenzo Pieralisi, Krzysztof Wilczyński, linux-pci,
	linux-renesas-soc, linux-kernel


On Wed, 23 Sep 2026 21:04:11 -0400, Yuho Choi wrote:
> PCI: rcar: Release temporary device tree node reference

Applied, thanks!

[1/1] PCI: rcar: Release temporary device tree node reference
      commit: 186da40837a4a2472b8afbf7dbccbe1b1e0f16bf

Best regards,
-- 
மணிவண்ணன் சதாசிவம்



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] PCI: rcar: Release temporary device tree node reference
  2026-09-24  1:04 [PATCH v2] PCI: rcar: Release temporary device tree node reference Yuho Choi
                   ` (2 preceding siblings ...)
  2026-10-27 11:50 ` Manivannan Sadhasivam
@ 2026-11-04 17:55 ` Bjorn Helgaas
  3 siblings, 0 replies; 5+ messages in thread
From: Bjorn Helgaas @ 2026-11-04 17:55 UTC (permalink / raw)
  To: Yuho Choi
  Cc: Marek Vasut, Manivannan Sadhasivam, Yoshihiro Shimoda,
	Geert Uytterhoeven, Rob Herring, Bjorn Helgaas,
	Lorenzo Pieralisi, Krzysztof Wilczyński, linux-pci,
	linux-renesas-soc, linux-kernel

On Wed, Sep 23, 2026 at 09:04:11PM -0400, Yuho Choi wrote:
> of_find_matching_node() returns a referenced node even when it is used
> only as a boolean test. Drop the reference right after the match check.

I guess this actually fixes an of_node reference leak, right?

> Fixes: a115b1bd3af0 ("PCI: rcar: Add L1 link state fix into data abort hook")
> Signed-off-by: Yuho Choi <oss.patchbox@gmail.com>
> ---
> Changes in v2:
> - Use an explicit of_node_put() instead of __free(device_node) (Marek Vasut)
> - Switch to my oss.patchbox address
> 
> v1: https://lore.kernel.org/all/20260801233841.469826-1-dbgh9129@gmail.com/
> 
>  drivers/pci/controller/pcie-rcar-host.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/pci/controller/pcie-rcar-host.c b/drivers/pci/controller/pcie-rcar-host.c
> index cd9171eebc289..1f5e33c802b5b 100644
> --- a/drivers/pci/controller/pcie-rcar-host.c
> +++ b/drivers/pci/controller/pcie-rcar-host.c
> @@ -1122,7 +1122,11 @@ static const struct of_device_id rcar_pcie_abort_handler_of_match[] __initconst
>  
>  static int __init rcar_pcie_init(void)
>  {
> -	if (of_find_matching_node(NULL, rcar_pcie_abort_handler_of_match)) {
> +	struct device_node *np;
> +
> +	np = of_find_matching_node(NULL, rcar_pcie_abort_handler_of_match);
> +	if (np) {
> +		of_node_put(np);
>  #ifdef CONFIG_ARM_LPAE
>  		hook_fault_code(17, rcar_pcie_aarch32_abort_handler, SIGBUS, 0,
>  				"asynchronous external abort");
> 
> base-commit: f0100363d8c374bd8e9ea7c9ba02744f0b802ca4
> -- 
> 2.43.0
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-11-04 17:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-24  1:04 [PATCH v2] PCI: rcar: Release temporary device tree node reference Yuho Choi
2026-09-24  6:51 ` Geert Uytterhoeven
2026-09-25  4:31 ` Marek Vasut
2026-10-27 11:50 ` Manivannan Sadhasivam
2026-11-04 17:55 ` Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®