drm/tegra: Check for NULL pointer instead of IS_ERR()
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 4 Dec 2014 11:00:35 +0000 (14:00 +0300)
committerThierry Reding <treding@nvidia.com>
Tue, 27 Jan 2015 09:14:36 +0000 (10:14 +0100)
iommu_domain_alloc() returns NULL on error, it never returns error
pointers.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/gpu/drm/tegra/drm.c

index a0c18ae79029102d0d8a0ba7a56d876a9c003790..219f314cc162c0bee55ee797ee96aa21fdb6656f 100644 (file)
@@ -36,8 +36,8 @@ static int tegra_drm_load(struct drm_device *drm, unsigned long flags)
 
        if (iommu_present(&platform_bus_type)) {
                tegra->domain = iommu_domain_alloc(&platform_bus_type);
-               if (IS_ERR(tegra->domain)) {
-                       err = PTR_ERR(tegra->domain);
+               if (!tegra->domain) {
+                       err = -ENOMEM;
                        goto free;
                }