iommu/sun50i: Fix return value check in sun50i_iommu_probe()
Subsystems (3)
PATCH 1/1 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 4100b8c229b3 ("iommu: Add Allwinner H6 IOMMU driver")
Reported-by Hulk Robot <[email protected]>
Signed-off-by Wei Yongjun <[email protected]>
--- drivers/iommu/sun50i-iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/sun50i-iommu.c +1 -1
@@ -941,7 +941,7 @@ static int sun50i_iommu_probe(struct platform_device *pdev) } iommu->base =devm_platform_ioremap_resource (pdev,0 ); -if (!iommu->base) { +if (IS_ERR (iommu->base)) { ret =PTR_ERR (iommu->base); goto err_free_group; }
Quoted 7 lines · Wei Yongjun
In case of error, the function
devm_platform_ioremap_resource()returnsERR_PTR()not NULL. The NULL test in the return value check must be replaced withIS_ERR().Fixes 4100b8c229b3 ("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]>
Thanks!
Maxime
Quoted 10 lines · Wei Yongjun
In case of error, the function
devm_platform_ioremap_resource()returnsERR_PTR()not NULL. The NULL test in the return value check must be replaced withIS_ERR().Fixes 4100b8c229b3 ("iommu: Add Allwinner H6 IOMMU driver")Reported-by Hulk Robot <[email protected]>Signed-off-by Wei Yongjun <[email protected]>--- drivers/iommu/sun50i-iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied, thanks.