Skip to contentSkip to conversation

iommu/qcom: add missing put_device() call in qcom_iommu_of_xlate()

PATCH Markus Elfring 1 participant 1 message Sep 18, 2020

lore
Share & tools
lore
#0 lore raw

…

Quoted 1 line

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

…

Review static int qcom_iommu_of_xlate(struct device *dev, struct of_phandle_args *args) · line 602

Quoted 7 lines
(quoted diff) +1 -0
@@ -595,6 +597,7 @@ static int qcom_iommu_of_xlate(struct device *dev, struct of_phandle_args *args)
 		 * banks are ok, but multiple devices are not:
 		 */
 		if (WARN_ON(qcom_iommu != dev_iommu_priv_get(dev)))
+			put_device(&iommu_pdev->dev);
 			return -EINVAL;
 	}

* Would there be a need to use curly brackets for such an if branch?

* I suggest to add a jump target so that a bit of common exception handling code can be better reused for this function implementation.

Regards,
Markus
_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu