Skip to content

Commit 93665e0

Browse files
Yuuoniywilldeacon
authored andcommitted
iommu/arm-smmu: Add missing pm_runtime_disable() in qcom_iommu_device_probe
If the probe fails, we should use pm_runtime_disable() to balance pm_runtime_enable(). Add missing pm_runtime_disable() for error handling. Signed-off-by: Miaoqian Lin <linmq006@gmail.com> Link: https://lore.kernel.org/r/20220105101619.29108-1-linmq006@gmail.com Signed-off-by: Will Deacon <will@kernel.org>
1 parent fcdeb8c commit 93665e0

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

drivers/iommu/arm/arm-smmu/qcom_iommu.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -827,20 +827,20 @@ static int qcom_iommu_device_probe(struct platform_device *pdev)
827827
ret = devm_of_platform_populate(dev);
828828
if (ret) {
829829
dev_err(dev, "Failed to populate iommu contexts\n");
830-
return ret;
830+
goto err_pm_disable;
831831
}
832832

833833
ret = iommu_device_sysfs_add(&qcom_iommu->iommu, dev, NULL,
834834
dev_name(dev));
835835
if (ret) {
836836
dev_err(dev, "Failed to register iommu in sysfs\n");
837-
return ret;
837+
goto err_pm_disable;
838838
}
839839

840840
ret = iommu_device_register(&qcom_iommu->iommu, &qcom_iommu_ops, dev);
841841
if (ret) {
842842
dev_err(dev, "Failed to register iommu\n");
843-
return ret;
843+
goto err_pm_disable;
844844
}
845845

846846
bus_set_iommu(&platform_bus_type, &qcom_iommu_ops);
@@ -852,6 +852,10 @@ static int qcom_iommu_device_probe(struct platform_device *pdev)
852852
}
853853

854854
return 0;
855+
856+
err_pm_disable:
857+
pm_runtime_disable(dev);
858+
return ret;
855859
}
856860

857861
static int qcom_iommu_device_remove(struct platform_device *pdev)

0 commit comments

Comments
 (0)