drm/i915: checking for NULL instead of IS_ERR()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 19 Jul 2013 05:45:46 +0000 (08:45 +0300)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 19 Jul 2013 06:58:33 +0000 (08:58 +0200)
i915_gem_vma_create() returns and ERR_PTR() or a valid pointer, it never
returns NULL.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_gem.c
drivers/gpu/drm/i915/i915_gem_stolen.c

index bd8c0086d0c1713cf96ea0efc8051a833582ef50..56642d8eb93735af9b3b4a299bde24ee16190892 100644 (file)
@@ -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:
index fc894f7d32e149d703c1bd8da1361642c6f53197..9a1896c86dcd15aa9d7c3df04b261e87c3ea666e 100644 (file)
@@ -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;
        }