linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PCI: dwc: fix reference leak in pex_ep_event_pex_rst_deassert
@ 2020-11-02 14:30 Zhang Qilong
  2020-11-03  2:52 ` Vidya Sagar
  0 siblings, 1 reply; 7+ messages in thread
From: Zhang Qilong @ 2020-11-02 14:30 UTC (permalink / raw)
  To: lorenzo.pieralisi, robh, bhelgaas, thierry.reding, jonathanh
  Cc: linux-pci, linux-tegra

pm_runtime_get_sync will increment pm usage counter even it
failed. Forgetting to pm_runtime_put_noidle will result in
reference leak in pex_ep_event_pex_rst_deassert, so we should
fix it.

Fixes: c57247f940e8e ("PCI: tegra: Add support for PCIe endpoint mode in Tegra194")
Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
---
 drivers/pci/controller/dwc/pcie-tegra194.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c
index f920e7efe118..936510b5c649 100644
--- a/drivers/pci/controller/dwc/pcie-tegra194.c
+++ b/drivers/pci/controller/dwc/pcie-tegra194.c
@@ -1662,6 +1662,7 @@ static void pex_ep_event_pex_rst_deassert(struct tegra_pcie_dw *pcie)
 
 	ret = pm_runtime_get_sync(dev);
 	if (ret < 0) {
+		pm_runtime_put_noidle(dev);
 		dev_err(dev, "Failed to get runtime sync for PCIe dev: %d\n",
 			ret);
 		return;
-- 
2.17.1


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

end of thread, other threads:[~2021-03-23 10:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-02 14:30 [PATCH] PCI: dwc: fix reference leak in pex_ep_event_pex_rst_deassert Zhang Qilong
2020-11-03  2:52 ` Vidya Sagar
2020-11-03  3:14   ` 答复: " zhangqilong
2021-01-25 16:34     ` Lorenzo Pieralisi
2021-01-27  6:19       ` Vidya Sagar
2021-01-25 19:30   ` Jon Hunter
2021-03-23 10:24     ` Lorenzo Pieralisi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).