Commit db473b36 authored by Dan Carpenter's avatar Dan Carpenter Committed by Daniel Vetter

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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent bf8fa3d3
...@@ -3134,9 +3134,9 @@ i915_gem_object_bind_to_gtt(struct drm_i915_gem_object *obj, ...@@ -3134,9 +3134,9 @@ i915_gem_object_bind_to_gtt(struct drm_i915_gem_object *obj,
i915_gem_object_pin_pages(obj); i915_gem_object_pin_pages(obj);
vma = i915_gem_vma_create(obj, &dev_priv->gtt.base); vma = i915_gem_vma_create(obj, &dev_priv->gtt.base);
if (vma == NULL) { if (IS_ERR(vma)) {
i915_gem_object_unpin_pages(obj); i915_gem_object_unpin_pages(obj);
return -ENOMEM; return PTR_ERR(vma);
} }
search_free: search_free:
......
...@@ -392,8 +392,8 @@ i915_gem_object_create_stolen_for_preallocated(struct drm_device *dev, ...@@ -392,8 +392,8 @@ i915_gem_object_create_stolen_for_preallocated(struct drm_device *dev,
return obj; return obj;
vma = i915_gem_vma_create(obj, &dev_priv->gtt.base); vma = i915_gem_vma_create(obj, &dev_priv->gtt.base);
if (!vma) { if (IS_ERR(vma)) {
ret = -ENOMEM; ret = PTR_ERR(vma);
goto err_out; goto err_out;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment