iommu/sun50i: Fix return value check in sun50i_iommu_probe()
authorWei Yongjun <weiyongjun1@huawei.com>
Tue, 19 May 2020 09:18:57 +0000 (09:18 +0000)
committerJoerg Roedel <jroedel@suse.de>
Tue, 19 May 2020 12:06:15 +0000 (14:06 +0200)
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 <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Acked-by: Maxime Ripard <mripard@kernel.org>
Link: https://lore.kernel.org/r/20200519091857.134170-1-weiyongjun1@huawei.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/sun50i-iommu.c

index 9c763d4a8e2a4c0e58a7538ab74777aff8a872f6..1fa09ddcebd45a91938da280b385bdc95a1c66ce 100644 (file)
@@ -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;
        }