From: Johan Hovold <johan@kernel.org>
To: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Johan Hovold <johan+linaro@kernel.org>,
Bjorn Helgaas <bhelgaas@google.com>,
Manivannan Sadhasivam <mani@kernel.org>,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH 2/3] PCI/pwrctrl: Fix device and OF node leak at bus scan
Date: Tue, 22 Jul 2025 14:04:23 +0200 [thread overview]
Message-ID: <aH9-R8eHdr31b4HA@hovoldconsulting.com> (raw)
In-Reply-To: <20250722110833.0000542d@huawei.com>
On Tue, Jul 22, 2025 at 11:08:33AM +0100, Jonathan Cameron wrote:
> On Mon, 21 Jul 2025 17:36:08 +0200
> Johan Hovold <johan+linaro@kernel.org> wrote:
> > @@ -2515,9 +2515,15 @@ static struct platform_device *pci_pwrctrl_create_device(struct pci_bus *bus, in
> > struct device_node *np;
> >
> > np = of_pci_find_child_device(dev_of_node(&bus->dev), devfn);
> > - if (!np || of_find_device_by_node(np))
> > + if (!np)
> > return NULL;
> >
> > + pdev = of_find_device_by_node(np);
> Given we have two entirely different pdevs in here, I'd use an extra
> local variable to indicate what this one is the pwctrl one created below.
It's actually the same pwrctrl platform device (which may have been
created in an earlier call to the function) so using the same variable
should be fine.
Johan
next prev parent reply other threads:[~2025-07-22 12:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20250721153609.8611-1-johan+linaro@kernel.org>
2025-07-21 15:36 ` [PATCH 1/3] PCI/pwrctrl: Fix device leak at registration Johan Hovold
2025-07-22 10:05 ` Jonathan Cameron
2025-07-22 12:00 ` Johan Hovold
2025-07-22 18:33 ` Markus Elfring
2025-07-21 15:36 ` [PATCH 2/3] PCI/pwrctrl: Fix device and OF node leak at bus scan Johan Hovold
2025-07-22 10:08 ` Jonathan Cameron
2025-07-22 12:04 ` Johan Hovold [this message]
2025-07-21 15:36 ` [PATCH 3/3] PCI/pwrctrl: Fix device leak at device stop Johan Hovold
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=aH9-R8eHdr31b4HA@hovoldconsulting.com \
--to=johan@kernel.org \
--cc=Jonathan.Cameron@huawei.com \
--cc=bhelgaas@google.com \
--cc=johan+linaro@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=mani@kernel.org \
--cc=stable@vger.kernel.org \
/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