mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Marek Vasut <marek.vasut@mailbox.org>
To: Fuad Tabba <fuad.tabba@linux.dev>
Cc: "Manivannan Sadhasivam" <mani@kernel.org>,
	"Yoshihiro Shimoda" <yoshihiro.shimoda.uh@renesas.com>,
	"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
	"Krzysztof Wilczyński" <kwilczynski@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Geert Uytterhoeven" <geert+renesas@glider.be>,
	"Magnus Damm" <magnus.damm@gmail.com>,
	linux-pci@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	linux-kernel@vger.kernel.org, "Will Deacon" <will@kernel.org>,
	"Fuad Tabba" <tabba@google.com>
Subject: Re: [PATCH] PCI: rcar-gen4: Fix device_node leak in rcar_gen4_pcie_host_msi_addr()
Date: Tue, 22 Sep 2026 20:07:52 +0200	[thread overview]
Message-ID: <61488ddc-b346-4ba3-b32a-e972a3bd75a4@mailbox.org> (raw)
In-Reply-To: <20260922063830.472642-1-fuad.tabba@linux.dev>

On 9/22/26 8:38 AM, Fuad Tabba wrote:

Hello Fuad,

> On Mon, 21 Sep 2026 22:47:30 +0200, Marek Vasut <marek.vasut@mailbox.org> wrote:
> 
> [...]
> 
>> I think you have to call of_node_put() on msi_node(), so what about this
>> instead ?
> 
> The __free(device_node) is that call: it puts msi_node on every return from the function, the success path included, so no goto is needed. It's the same scoped cleanup pci-imx6.c and pcie-rzg3s-host.c use for their device_node lookups.

Oh, this is very nice, TIL, thank you.

Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Tested-by: Marek Vasut <marek.vasut+renesas@mailbox.org> # Retronix 
R-Car V4H Sparrow Hawk

>> diff --git a/drivers/pci/controller/dwc/pcie-rcar-gen4.c
> 
> [...]
> 
>> "
>>
>> Also, I think drivers/pci/controller/pcie-iproc.c
>> iproc_pcie_msi_enable() needs similar fix ?
> 
> I don't think so: iproc_pcie_msi_enable() already puts the node at out_put_node, on the steer failure and the success paths alike.

Could you maybe send similar simplification patch ?

Thank you !

-- 
Best regards,
Marek Vasut

  reply	other threads:[~2026-09-22 18:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-18  9:10 Fuad Tabba
2026-09-21 20:47 ` Marek Vasut
2026-09-22  6:38   ` Fuad Tabba
2026-09-22 18:07     ` Marek Vasut [this message]
2026-09-22 21:11       ` Fuad Tabba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=61488ddc-b346-4ba3-b32a-e972a3bd75a4@mailbox.org \
    --to=marek.vasut@mailbox.org \
    --cc=bhelgaas@google.com \
    --cc=fuad.tabba@linux.dev \
    --cc=geert+renesas@glider.be \
    --cc=kwilczynski@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=mani@kernel.org \
    --cc=robh@kernel.org \
    --cc=tabba@google.com \
    --cc=will@kernel.org \
    --cc=yoshihiro.shimoda.uh@renesas.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®