[Intel-gfx] [PATCH] drm/i915: Unset mmap_offset on failure path.

Chris Wilson chris at chris-wilson.co.uk
Sat Jul 10 09:58:55 CEST 2010


If we fail to correctly setup the mapping for an object, make sure that
we nullify the pointer within the object after tearing down. Otherwise,
we may later attempt to reuse the invalid pointer...

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
Cc: stable at kernel.org
---
 drivers/gpu/drm/i915/i915_gem.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 52643dd..ed2803f 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1261,6 +1261,7 @@ out_free_mm:
 	drm_mm_put_block(list->file_offset_node);
 out_free_list:
 	kfree(list->map);
+	list->map = NULL;
 
 	return ret;
 }
-- 
1.7.1




More information about the Intel-gfx mailing list