DORMANTno replies

[PATCH] iommu/rockchip: Fix silent probe success when all MMU resources fail

From: ZhaoJinming <hidden>
Date: 2026-07-23 13:27:55
Also in: linux-iommu, linux-rockchip, lkml
Subsystem: arm/rockchip soc support, iommu subsystem, the rest · Maintainers: Heiko Stuebner, Joerg Roedel, Will Deacon, Linus Torvalds

When all MMU register mappings fail in rk_iommu_probe(), the error
path returns PTR_ERR(iommu->bases[0]). However, bases[0] can be NULL
if the first platform_get_resource() also returned NULL, causing
PTR_ERR(NULL) to evaluate to 0 and the probe to succeed silently.

Return -ENODEV directly instead.

Signed-off-by: ZhaoJinming <redacted>
---
drivers/iommu/rockchip-iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c
index 87ae036d6414..32868ea5fa03 100644
--- a/drivers/iommu/rockchip-iommu.c
+++ b/drivers/iommu/rockchip-iommu.c
@@ -1245,7 +1245,7 @@ static int rk_iommu_probe(struct platform_device *pdev)
 		iommu->num_mmu++;
 	}
 	if (iommu->num_mmu == 0)
-		return PTR_ERR(iommu->bases[0]);
+		return -ENODEV;
 
 	iommu->num_irq = platform_irq_count(pdev);
 	if (iommu->num_irq < 0)
-- 
2.20.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help