mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 20:54:03 +02:00
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:
parent
414cb6f3ac
commit
ea0a9d453f
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user