Re: [PATCH] drm/i915: Do not leak objects after capturing error state

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx





[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux