[Intel-gfx] [PATCH] drm/i915: Do not leak objects after capturing error state
Chris Wilson
chris at chris-wilson.co.uk
Thu Mar 19 10:18:12 PDT 2015
On Thu, Mar 19, 2015 at 05:11:17PM +0000, Michel Thierry wrote:
> diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
> index bbf25d0..18f7a2a 100644
> --- a/drivers/gpu/drm/i915/i915_gpu_error.c
> +++ b/drivers/gpu/drm/i915/i915_gpu_error.c
> @@ -545,7 +545,7 @@ static void i915_error_state_free(struct kref *error_ref)
> {
> struct drm_i915_error_state *error = container_of(error_ref,
> typeof(*error), ref);
> - int i;
> + int i, j;
No need for a new iterator.
>
> for (i = 0; i < ARRAY_SIZE(error->ring); i++) {
> i915_error_object_free(error->ring[i].batchbuffer);
> @@ -556,7 +556,14 @@ static void i915_error_state_free(struct kref *error_ref)
> }
>
> i915_error_object_free(error->semaphore_obj);
> +
> + for (i = 0; i < error->vm_count; i++)
> + kfree(error->active_bo[i]);
kfree(error->pinned_bo[i]);
Pinned_bo is also an overlooked array of pointers.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
More information about the Intel-gfx
mailing list