Thierry Reding
2014-Oct-16 09:54 UTC
[Nouveau] [PATCH] drm/nouveau: Do not leak client objects
From: Thierry Reding <treding at 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 at 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 -- 2.1.2
Thierry Reding
2015-Jun-05 11:35 UTC
[Nouveau] [PATCH] drm/nouveau: Do not leak client objects
On Thu, Oct 16, 2014 at 11:54:54AM +0200, Thierry Reding wrote:> From: Thierry Reding <treding at 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 at 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 voidBen, any chance you could pick this up? Thierry -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.freedesktop.org/archives/nouveau/attachments/20150605/7bfd8e40/attachment.sig>
Ben Skeggs
2015-Jun-06 13:36 UTC
[Nouveau] [PATCH] drm/nouveau: Do not leak client objects
On 5 June 2015 at 21:35, Thierry Reding <thierry.reding at gmail.com> wrote:> On Thu, Oct 16, 2014 at 11:54:54AM +0200, Thierry Reding wrote: >> From: Thierry Reding <treding at 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 at 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 at lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/nouveau >
Maybe Matching Threads
- [PATCH] drm/nouveau: fix early vram corruption originating from vgacon
- [PATCH] [RFC] drm/nouveau: bring back hdmi audio device after switcheroo power down
- [RFC 00/16] drm/nouveau: initial support for GK20A (Tegra K1)
- [RFC 07/16] drm/nouveau/bar/nvc0: support chips without BAR3
- [PATCH] [RFC] drm/nouveau: bring back hdmi audio device after switcheroo power down