blob: 4cdc47c6bc8c8615e802991c2ccf0e98d1ed1222 [file] [log] [blame]
From fa20686f5067a32dc89268886469fcc5213a3066 Mon Sep 17 00:00:00 2001
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Fri, 19 Jul 2013 08:45:46 +0300
Subject: 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 <dan.carpenter@oracle.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
(cherry picked from commit db473b36d4a2eb02c65aefca11578698b3699fe0)
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
---
drivers/gpu/drm/i915/i915_gem.c | 4 ++--
drivers/gpu/drm/i915/i915_gem_stolen.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 3200a201bcba..5a0f78dfd0bf 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -3120,9 +3120,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 f52613605fe1..27ffb4c865fa 100644
--- a/drivers/gpu/drm/i915/i915_gem_stolen.c
+++ b/drivers/gpu/drm/i915/i915_gem_stolen.c
@@ -395,8 +395,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;
}
--
1.8.5.rc3