All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michel Thierry <michel.thierry@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Do not leak objects after capturing error state
Date: Thu, 19 Mar 2015 17:49:44 +0000	[thread overview]
Message-ID: <550B0C38.2050106@intel.com> (raw)
In-Reply-To: <20150319171812.GW10812@nuc-i3427.alporthouse.com>

On 3/19/2015 5:18 PM, Chris Wilson wrote:
> 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.
Ok, I'll reuse 'i'.
>>   	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.
But pinned_bo elements were not explicitly allocated with kcalloc.
I'd get warnings that they are already freed.

Thanks
> -Chris
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2015-03-19 17:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-19 17:11 [PATCH] drm/i915: Do not leak objects after capturing error state Michel Thierry
2015-03-19 17:18 ` Chris Wilson
2015-03-19 17:49   ` Michel Thierry [this message]
2015-03-19 21:02     ` Chris Wilson
2015-03-20  5:41 ` shuang.he
2015-03-20  9:41 ` [PATCH v2] " Michel Thierry
2015-03-20 14:47   ` Daniel Vetter
2015-03-20 19:23   ` shuang.he

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=550B0C38.2050106@intel.com \
    --to=michel.thierry@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.