summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhaoJinming <zhaojinming@uniontech.com>2026-07-23 21:26:43 +0800
committerWill Deacon <will@kernel.org>2026-07-26 12:35:44 +0000
commitea0a9d453f60d5d065c377bbd20ab8a78b8620b7 (patch)
tree765369e94f6558e80d0cb22b3131daae93e1992c
parent414cb6f3ac6217d67963d53866e0fc2288dd3556 (diff)
downloadlinux-next-ea0a9d453f60d5d065c377bbd20ab8a78b8620b7.tar.gz
linux-next-ea0a9d453f60d5d065c377bbd20ab8a78b8620b7.zip
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>
-rw-r--r--drivers/iommu/rockchip-iommu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c
index d8cfce042dec..05643dbde26d 100644
--- a/drivers/iommu/rockchip-iommu.c
+++ b/drivers/iommu/rockchip-iommu.c
@@ -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)