Skip to content

Commit ae7d292

Browse files
Wei Yongjunjoergroedel
authored andcommitted
iommu/sun50i: Fix return value check in sun50i_iommu_probe()
In case of error, the function devm_platform_ioremap_resource() returns ERR_PTR() not NULL. The NULL test in the return value check must be replaced with IS_ERR(). Fixes: 4100b8c ("iommu: Add Allwinner H6 IOMMU driver") Reported-by: Hulk Robot <[email protected]> Signed-off-by: Wei Yongjun <[email protected]> Acked-by: Maxime Ripard <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
1 parent 38b91f8 commit ae7d292

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/iommu/sun50i-iommu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -941,7 +941,7 @@ static int sun50i_iommu_probe(struct platform_device *pdev)
941941
}
942942

943943
iommu->base = devm_platform_ioremap_resource(pdev, 0);
944-
if (!iommu->base) {
944+
if (IS_ERR(iommu->base)) {
945945
ret = PTR_ERR(iommu->base);
946946
goto err_free_group;
947947
}

0 commit comments

Comments
 (0)