diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-03-20 07:20:19 -0400 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-03-23 05:17:02 -0400 |
commit | 26e12f894317bf0221fed40bef6f937538a78c0b (patch) | |
tree | 2dd321afe54ee37e7022d9f12a6a854a1d3547e4 /drivers | |
parent | 36d527deadf7d0c302e3452dde39465e74a65a08 (diff) |
drm/i915: Fix use after free within tracepoint
Detected by scripts/coccinelle/free/kfree.cocci.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index edd6098743b..c9bdaf208a9 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
@@ -3603,6 +3603,8 @@ static void i915_gem_free_object_tail(struct drm_i915_gem_object *obj) | |||
3603 | return; | 3603 | return; |
3604 | } | 3604 | } |
3605 | 3605 | ||
3606 | trace_i915_gem_object_destroy(obj); | ||
3607 | |||
3606 | if (obj->base.map_list.map) | 3608 | if (obj->base.map_list.map) |
3607 | i915_gem_free_mmap_offset(obj); | 3609 | i915_gem_free_mmap_offset(obj); |
3608 | 3610 | ||
@@ -3612,8 +3614,6 @@ static void i915_gem_free_object_tail(struct drm_i915_gem_object *obj) | |||
3612 | kfree(obj->page_cpu_valid); | 3614 | kfree(obj->page_cpu_valid); |
3613 | kfree(obj->bit_17); | 3615 | kfree(obj->bit_17); |
3614 | kfree(obj); | 3616 | kfree(obj); |
3615 | |||
3616 | trace_i915_gem_object_destroy(obj); | ||
3617 | } | 3617 | } |
3618 | 3618 | ||
3619 | void i915_gem_free_object(struct drm_gem_object *gem_obj) | 3619 | void i915_gem_free_object(struct drm_gem_object *gem_obj) |