From: Dan Carpenter Date: Fri, 19 Jul 2013 05:45:46 +0000 (+0300) Subject: drm/i915: checking for NULL instead of IS_ERR() X-Git-Tag: v3.12-rc2~3^2~143^2~34 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=db473b36d4a2eb02c65aefca11578698b3699fe0;p=kernel%2Fkernel-generic.git drm/i915: checking for NULL instead of IS_ERR() i915_gem_vma_create() returns and ERR_PTR() or a valid pointer, it never returns NULL. Signed-off-by: Dan Carpenter Signed-off-by: Daniel Vetter --- diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index bd8c008..56642d8 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -3134,9 +3134,9 @@ i915_gem_object_bind_to_gtt(struct drm_i915_gem_object *obj, i915_gem_object_pin_pages(obj); vma = i915_gem_vma_create(obj, &dev_priv->gtt.base); - if (vma == NULL) { + if (IS_ERR(vma)) { i915_gem_object_unpin_pages(obj); - return -ENOMEM; + return PTR_ERR(vma); } search_free: diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c b/drivers/gpu/drm/i915/i915_gem_stolen.c index fc894f7..9a1896c 100644 --- a/drivers/gpu/drm/i915/i915_gem_stolen.c +++ b/drivers/gpu/drm/i915/i915_gem_stolen.c @@ -392,8 +392,8 @@ i915_gem_object_create_stolen_for_preallocated(struct drm_device *dev, return obj; vma = i915_gem_vma_create(obj, &dev_priv->gtt.base); - if (!vma) { - ret = -ENOMEM; + if (IS_ERR(vma)) { + ret = PTR_ERR(vma); goto err_out; }