drm/nouveau/tegra: Fix error handling
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Mon, 31 Oct 2016 06:35:50 +0000 (07:35 +0100)
committerBen Skeggs <bskeggs@redhat.com>
Mon, 7 Nov 2016 04:04:40 +0000 (14:04 +1000)
'iommu_domain_alloc()' returns NULL in case of error, not an error pointer.
So test it accordingly.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c

index 9b638bd905ffa471e7cb0cfb04bf0d3274c211ce..f2bc0b7d9b9351bf5b3db61863a688c1d537b95c 100644 (file)
@@ -102,7 +102,7 @@ nvkm_device_tegra_probe_iommu(struct nvkm_device_tegra *tdev)
 
        if (iommu_present(&platform_bus_type)) {
                tdev->iommu.domain = iommu_domain_alloc(&platform_bus_type);
-               if (IS_ERR(tdev->iommu.domain))
+               if (!tdev->iommu.domain)
                        goto error;
 
                /*