Skip to content

Commit

Permalink
drm/i915: Fix use after free within tracepoint
Browse files Browse the repository at this point in the history
Detected by scripts/coccinelle/free/kfree.cocci.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Keith Packard <keithp@keithp.com>
  • Loading branch information
Chris Wilson committed Mar 23, 2011
1 parent 36d527d commit 26e12f8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/gpu/drm/i915/i915_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -3603,6 +3603,8 @@ static void i915_gem_free_object_tail(struct drm_i915_gem_object *obj)
return;
}

trace_i915_gem_object_destroy(obj);

if (obj->base.map_list.map)
i915_gem_free_mmap_offset(obj);

Expand All @@ -3612,8 +3614,6 @@ static void i915_gem_free_object_tail(struct drm_i915_gem_object *obj)
kfree(obj->page_cpu_valid);
kfree(obj->bit_17);
kfree(obj);

trace_i915_gem_object_destroy(obj);
}

void i915_gem_free_object(struct drm_gem_object *gem_obj)
Expand Down

0 comments on commit 26e12f8

Please sign in to comment.