[Intel-gfx] [PATCH 1/2] drm/i915: Fix up ERR_PTR handling for pinning the ringbuffer

Chris Wilson chris at chris-wilson.co.uk
Tue Apr 12 13:32:30 UTC 2016


In commit 0a798eb92e6dcc1cba45d13d7b75a523e5d0fc4c
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Apr 8 12:11:11 2016 +0100

    drm/i915: Refactor duplicate object vmap functions

the vmap function that returned NULL on error was replaced by one that
returned an error pointer instead. Not all callsites were updated...

Reported-by: Dave Gordon <david.s.gordon at intel.com>
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
Cc: Dave Gordon <david.s.gordon at intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin at linux.intel.com>
---
 drivers/gpu/drm/i915/intel_ringbuffer.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index 41b604e69db7..15064a8f706b 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -2108,8 +2108,9 @@ int intel_pin_and_map_ringbuffer_obj(struct drm_device *dev,
 			goto err_unpin;
 
 		ringbuf->virtual_start = i915_gem_object_pin_map(obj);
-		if (ringbuf->virtual_start == NULL) {
-			ret = -ENOMEM;
+		if (IS_ERR(ringbuf->virtual_start)) {
+			ret = PTR_ERR(ringbuf->virtual_start);
+			ringbuf->virtual_start = NULL;
 			goto err_unpin;
 		}
 	} else {
-- 
2.8.0.rc3



More information about the Intel-gfx mailing list