PCI: rcar: handle the failure case of pm_runtime_get_sync
Subsystems (4)
PATCH 1/1 PCI: rcar: handle the 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/pcie-rcar.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/pci/controller/pcie-rcar.c +1 -3
@@ -1137,7 +1137,7 @@ static int rcar_pcie_probe(struct platform_device *pdev) err =pm_runtime_get_sync (pcie->dev);if (err <0 ) {dev_err (pcie->dev,"pm_runtime_get_sync failed\n" ); - goto err_pm_disable; + goto err_pm_put; } err =rcar_pcie_get_resources (pcie);
@@ -1208,8 +1208,6 @@ static int rcar_pcie_probe(struct platform_device *pdev) err_pm_put:pm_runtime_put (dev); - -err_pm_disable:pm_runtime_disable (dev);pci_free_resource_list (&pcie->resources);
Signature · 1 line
2.17.1
Quoted 5 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]>
This looks like a V2 of
[PATCH] PCI: rcar: fix runtime pm imbalance on error
This looks good to me, but I'm no runtime-pm expert.