[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aH9-R8eHdr31b4HA@hovoldconsulting.com>
Date: Tue, 22 Jul 2025 14:04:23 +0200
From: Johan Hovold <johan@...nel.org>
To: Jonathan Cameron <Jonathan.Cameron@...wei.com>
Cc: Johan Hovold <johan+linaro@...nel.org>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Manivannan Sadhasivam <mani@...nel.org>, linux-pci@...r.kernel.org,
linux-kernel@...r.kernel.org, stable@...r.kernel.org
Subject: Re: [PATCH 2/3] PCI/pwrctrl: Fix device and OF node leak at bus scan
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@...nel.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
Powered by blists - more mailing lists