Skip to contentSkip to conversation

iommu/rockchip: Constrain return value of ->attach_dev()

PATCH Superseded Nicolin Chen 1 participant 1 message Sep 14, 2022

Subsystems (2)

v2 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 10/13 iommu/rockchip: Constrain return value of ->attach_dev()

Ensure attach_dev() callback functions only return errno values expected from the attach_dev() op.

---
 drivers/iommu/rockchip-iommu.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/iommu/rockchip-iommu.c +3 -1
index ab57c4b8fade..de483b5532ed 100644
@@ -1051,8 +1051,10 @@ static int rk_iommu_attach_device(struct iommu_domain *domain,
 		return 0;
 
 	ret = rk_iommu_enable(iommu);
-	if (ret)
+	if (ret) {
 		rk_iommu_detach_device(iommu->domain, dev);
+		ret = -ENODEV;
+	}
 
 	pm_runtime_put(iommu->dev);
 
Signature · 1 line
2.17.1