PCI: tegra: handle failure case of pm_runtime_get_sync
Subsystems (4)
PATCH 1/1 PCI: tegra: handle failure case of pm_runtime_get_sync
Calling pm_runtime_get_sync increments the counter even in case of failure, causing incorrect ref count. Call pm_runtime_put if pm_runtime_get_sync fails.
Signed-off-by Navid Emamdoost <[email protected]>
--- drivers/pci/controller/pci-tegra.c | 1 + 1 file changed, 1 insertion(+)
drivers/pci/controller/pci-tegra.c +1 -0
@@ -2712,6 +2712,7 @@ static int tegra_pcie_probe(struct platform_device *pdev) err =pm_runtime_get_sync (pcie->dev);if (err <0 ) {dev_err (dev,"fail to enable pcie controller: %d\n" , err); +pm_runtime_put_sync (pcie->dev); goto teardown_msi; }
Signature · 1 line
2.17.1
Jon Hunter
maintainerQuoted 14 lines · Navid Emamdoost
Calling
pm_runtime_get_syncincrements the counter even in case of failure, causing incorrect ref count. Callpm_runtime_putifpm_runtime_get_syncfails.Signed-off-by Navid Emamdoost <[email protected]>--- drivers/pci/controller/pci-tegra.c | 1 + 1 file changed, 1 insertion(+)drivers/pci/controller/pci-tegra.c +0
-0
drivers/pci/controller/pci-tegra.c static int tegra_pcie_probe(struct platform_device *pdev) · line 2717
Quoted 6 lines
drivers/pci/controller/pci-tegra.c +1
-0@@ -2712,6 +2712,7 @@ static int tegra_pcie_probe(struct platform_device *pdev) err =pm_runtime_get_sync (pcie->dev);if (err <0 ) {dev_err (dev,"fail to enable pcie controller: %d\n" , err); +pm_runtime_put_sync (pcie->dev); goto teardown_msi; }
Same thing for this patch, there is already a put in the error path and so it is not necessary to add the put call here. Just update the goto label.
Jon
Signature · 1 line
nvpublic