All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/nouveau: Do not leak client objects
@ 2014-10-16  9:54 Thierry Reding
  2015-06-05 11:35 ` Thierry Reding
  0 siblings, 1 reply; 3+ messages in thread
From: Thierry Reding @ 2014-10-16  9:54 UTC (permalink / raw)
  To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
  Cc: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

From: Thierry Reding <treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>

The memory allocated for a nouveau_cli object in nouveau_cli_create() is
never freed. Free the memory in nouveau_cli_destroy() to plug this leak.

kmemleak recorded this after running a couple of nouveau test programs.
Note that kmemleak points at drm_open_helper() because for some reason
it thinks that skipping the first two stack frames is a good idea.

Signed-off-by: Thierry Reding <treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
 drivers/gpu/drm/nouveau/nouveau_drm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c
index 57238076049f..6dc2c915ba6e 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
@@ -126,6 +126,7 @@ nouveau_cli_destroy(struct nouveau_cli *cli)
 	nouveau_vm_ref(NULL, &nvkm_client(&cli->base)->vm, NULL);
 	nvif_client_fini(&cli->base);
 	usif_client_fini(cli);
+	kfree(cli);
 }
 
 static void
-- 
2.1.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/nouveau: Do not leak client objects
  2014-10-16  9:54 [PATCH] drm/nouveau: Do not leak client objects Thierry Reding
@ 2015-06-05 11:35 ` Thierry Reding
       [not found]   ` <20150605113525.GF17776-AwZRO8vwLAwmlAP/+Wk3EA@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Thierry Reding @ 2015-06-05 11:35 UTC (permalink / raw)
  To: Ben Skeggs, nouveau; +Cc: dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 1164 bytes --]

On Thu, Oct 16, 2014 at 11:54:54AM +0200, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
> 
> The memory allocated for a nouveau_cli object in nouveau_cli_create() is
> never freed. Free the memory in nouveau_cli_destroy() to plug this leak.
> 
> kmemleak recorded this after running a couple of nouveau test programs.
> Note that kmemleak points at drm_open_helper() because for some reason
> it thinks that skipping the first two stack frames is a good idea.
> 
> Signed-off-by: Thierry Reding <treding@nvidia.com>
> ---
>  drivers/gpu/drm/nouveau/nouveau_drm.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c
> index 57238076049f..6dc2c915ba6e 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_drm.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
> @@ -126,6 +126,7 @@ nouveau_cli_destroy(struct nouveau_cli *cli)
>  	nouveau_vm_ref(NULL, &nvkm_client(&cli->base)->vm, NULL);
>  	nvif_client_fini(&cli->base);
>  	usif_client_fini(cli);
> +	kfree(cli);
>  }
>  
>  static void

Ben, any chance you could pick this up?

Thierry

[-- Attachment #1.2: Type: application/pgp-signature, Size: 819 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/nouveau: Do not leak client objects
       [not found]   ` <20150605113525.GF17776-AwZRO8vwLAwmlAP/+Wk3EA@public.gmane.org>
@ 2015-06-06 13:36     ` Ben Skeggs
  0 siblings, 0 replies; 3+ messages in thread
From: Ben Skeggs @ 2015-06-06 13:36 UTC (permalink / raw)
  To: Thierry Reding
  Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	Ben Skeggs,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org

On 5 June 2015 at 21:35, Thierry Reding <thierry.reding@gmail.com> wrote:
> On Thu, Oct 16, 2014 at 11:54:54AM +0200, Thierry Reding wrote:
>> From: Thierry Reding <treding@nvidia.com>
>>
>> The memory allocated for a nouveau_cli object in nouveau_cli_create() is
>> never freed. Free the memory in nouveau_cli_destroy() to plug this leak.
>>
>> kmemleak recorded this after running a couple of nouveau test programs.
>> Note that kmemleak points at drm_open_helper() because for some reason
>> it thinks that skipping the first two stack frames is a good idea.
>>
>> Signed-off-by: Thierry Reding <treding@nvidia.com>
>> ---
>>  drivers/gpu/drm/nouveau/nouveau_drm.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c
>> index 57238076049f..6dc2c915ba6e 100644
>> --- a/drivers/gpu/drm/nouveau/nouveau_drm.c
>> +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
>> @@ -126,6 +126,7 @@ nouveau_cli_destroy(struct nouveau_cli *cli)
>>       nouveau_vm_ref(NULL, &nvkm_client(&cli->base)->vm, NULL);
>>       nvif_client_fini(&cli->base);
>>       usif_client_fini(cli);
>> +     kfree(cli);
>>  }
>>
>>  static void
>
> Ben, any chance you could pick this up?
Got it :)  Thanks for the ping!

Ben.

>
> Thierry
>
> _______________________________________________
> Nouveau mailing list
> Nouveau@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/nouveau
>
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-06-06 13:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-16  9:54 [PATCH] drm/nouveau: Do not leak client objects Thierry Reding
2015-06-05 11:35 ` Thierry Reding
     [not found]   ` <20150605113525.GF17776-AwZRO8vwLAwmlAP/+Wk3EA@public.gmane.org>
2015-06-06 13:36     ` Ben Skeggs

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.