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

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 <zhaojinming@uniontech.com>
Signed-off-by: Will Deacon <will@kernel.org>
This commit is contained in:
ZhaoJinming 2026-07-23 21:26:43 +08:00 committed by Will Deacon
parent 414cb6f3ac
commit ea0a9d453f

View File

@ -1243,7 +1243,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)