Re: [PATCH] PCI: eswin: Fix resource leak on dw_pcie_host_init() failure
From: Manivannan Sadhasivam
Date: Tue May 12 2026 - 08:03:46 EST
On Fri, Apr 17, 2026 at 06:14:39PM +0800, Felix Gu wrote:
> On Fri, Apr 17, 2026 at 5:35 PM Manivannan Sadhasivam <mani@xxxxxxxxxx> wrote:
> >
> > Error path is really messed up. On pm_runtime_get_sync() failure, it should
> > go to 'err_free_ports' and on dw_pcie_host_init() failure, it should go to
> > err_pm_runtime_put.
> >
> > - Mani
> >
> > --
> > மணிவண்ணன் சதாசிவம்
> Hi Mani,
> For pm_runtime_get_sync() failure, it still needs a pm_runtime_put().
> So it doesn't need two labels here.
>
Ah, I missed the fact that we need pm_runtime_put() in error path also. But
still, the order should be reverse. First pm_runtime_put() and then
list_for_each_entry_safe().
- Mani
--
மணிவண்ணன் சதாசிவம்