From: Dan Carpenter Date: Thu, 4 Dec 2014 11:00:35 +0000 (+0300) Subject: drm/tegra: Check for NULL pointer instead of IS_ERR() X-Git-Tag: firefly_0821_release~176^2~2312^2~25^2~46 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=bf19b885f956eb0fec7dd7c02400b679dca7312e;p=firefly-linux-kernel-4.4.55.git drm/tegra: Check for NULL pointer instead of IS_ERR() iommu_domain_alloc() returns NULL on error, it never returns error pointers. Signed-off-by: Dan Carpenter Signed-off-by: Thierry Reding --- diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c index a0c18ae79029..219f314cc162 100644 --- a/drivers/gpu/drm/tegra/drm.c +++ b/drivers/gpu/drm/tegra/drm.c @@ -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; }