PCI: qcom: handle pm_runtime_get_sync failure case
Subsystems (4)
PATCH 1/1 PCI: qcom: handle pm_runtime_get_sync failure case
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/dwc/pcie-qcom.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/pci/controller/dwc/pcie-qcom.c +2 -4
@@ -1339,10 +1339,8 @@ static int qcom_pcie_probe(struct platform_device *pdev)pm_runtime_enable (dev); ret =pm_runtime_get_sync (dev); -if (ret <0 ) { -pm_runtime_disable (dev); -return ret; - } +if (ret <0 ) + goto err_pm_runtime_put; pci->dev = dev; pci->ops = &dw_pcie_ops;
Signature · 1 line
2.17.1
Quoted 8 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/dwc/pcie-qcom.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
Navid, I will review and merge Dinghao's version of these patches[1] since he posted them first, I will drop yours from the PCI patch queue, thanks anyway for posting them.
Lorenzo
[1] https://patchwork.kernel.org/patch/11559819/
Quoted 20 lines
drivers/pci/controller/dwc/pcie-qcom.c +2
-4@@ -1339,10 +1339,8 @@ static int qcom_pcie_probe(struct platform_device *pdev)pm_runtime_enable (dev); ret =pm_runtime_get_sync (dev); -if (ret <0 ) { -pm_runtime_disable (dev); -return ret; - } +if (ret <0 ) + goto err_pm_runtime_put; pci->dev = dev; pci->ops = &dw_pcie_ops;Signature · 1 line
2.17.1