Marcin Slusarz
2010-Jan-12 14:32 UTC
[Nouveau] [libdrm PATCH] nouveau: fix memory leak in nouveau_channel_free
From: Marcin Slusarz <marcin.slusarz at gmail.com> Subject: [libdrm PATCH] nouveau: fix memory leak in nouveau_channel_free --- nouveau/nouveau_channel.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/nouveau/nouveau_channel.c b/nouveau/nouveau_channel.c index 638aee3..14cf4c6 100644 --- a/nouveau/nouveau_channel.c +++ b/nouveau/nouveau_channel.c @@ -102,6 +102,7 @@ nouveau_channel_free(struct nouveau_channel **chan) struct nouveau_channel_priv *nvchan; struct nouveau_device_priv *nvdev; struct drm_nouveau_channel_free cf; + int i; if (!chan || !*chan) return; @@ -115,6 +116,9 @@ nouveau_channel_free(struct nouveau_channel **chan) nouveau_bo_unmap(nvchan->notifier_bo); nouveau_bo_ref(NULL, &nvchan->notifier_bo); + for (i = 0; i < nvchan->drm.nr_subchan; i++) + free(nvchan->base.subc[i].gr); + nouveau_grobj_free(&nvchan->base.vram); nouveau_grobj_free(&nvchan->base.gart); nouveau_grobj_free(&nvchan->base.nullobj); -- 1.6.6.rc3
Maarten Maathuis
2010-Jan-14 22:30 UTC
[Nouveau] [libdrm PATCH] nouveau: fix memory leak in nouveau_channel_free
Could you resend these (not just this one) patches as proper git send-email patches, those have authorship too, so they can be used with git am. Maarten. On Tue, Jan 12, 2010 at 3:32 PM, Marcin Slusarz <marcin.slusarz at gmail.com> wrote:> From: Marcin Slusarz <marcin.slusarz at gmail.com> > Subject: [libdrm PATCH] nouveau: fix memory leak in nouveau_channel_free > > --- > ?nouveau/nouveau_channel.c | ? ?4 ++++ > ?1 files changed, 4 insertions(+), 0 deletions(-) > > diff --git a/nouveau/nouveau_channel.c b/nouveau/nouveau_channel.c > index 638aee3..14cf4c6 100644 > --- a/nouveau/nouveau_channel.c > +++ b/nouveau/nouveau_channel.c > @@ -102,6 +102,7 @@ nouveau_channel_free(struct nouveau_channel **chan) > ? ? ? ?struct nouveau_channel_priv *nvchan; > ? ? ? ?struct nouveau_device_priv *nvdev; > ? ? ? ?struct drm_nouveau_channel_free cf; > + ? ? ? int i; > > ? ? ? ?if (!chan || !*chan) > ? ? ? ? ? ? ? ?return; > @@ -115,6 +116,9 @@ nouveau_channel_free(struct nouveau_channel **chan) > ? ? ? ?nouveau_bo_unmap(nvchan->notifier_bo); > ? ? ? ?nouveau_bo_ref(NULL, &nvchan->notifier_bo); > > + ? ? ? for (i = 0; i < nvchan->drm.nr_subchan; i++) > + ? ? ? ? ? ? ? free(nvchan->base.subc[i].gr); > + > ? ? ? ?nouveau_grobj_free(&nvchan->base.vram); > ? ? ? ?nouveau_grobj_free(&nvchan->base.gart); > ? ? ? ?nouveau_grobj_free(&nvchan->base.nullobj); > -- > 1.6.6.rc3 > > _______________________________________________ > Nouveau mailing list > Nouveau at lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/nouveau >
Maarten Maathuis
2010-Jan-14 22:54 UTC
[Nouveau] [libdrm PATCH] nouveau: fix memory leak in nouveau_channel_free
Sorry, this was a brainfart. On Thu, Jan 14, 2010 at 11:30 PM, Maarten Maathuis <madman2003 at gmail.com> wrote:> Could you resend these (not just this one) patches as proper git > send-email patches, those have authorship too, so they can be used > with git am. > > Maarten. > > On Tue, Jan 12, 2010 at 3:32 PM, Marcin Slusarz > <marcin.slusarz at gmail.com> wrote: >> From: Marcin Slusarz <marcin.slusarz at gmail.com> >> Subject: [libdrm PATCH] nouveau: fix memory leak in nouveau_channel_free >> >> --- >> ?nouveau/nouveau_channel.c | ? ?4 ++++ >> ?1 files changed, 4 insertions(+), 0 deletions(-) >> >> diff --git a/nouveau/nouveau_channel.c b/nouveau/nouveau_channel.c >> index 638aee3..14cf4c6 100644 >> --- a/nouveau/nouveau_channel.c >> +++ b/nouveau/nouveau_channel.c >> @@ -102,6 +102,7 @@ nouveau_channel_free(struct nouveau_channel **chan) >> ? ? ? ?struct nouveau_channel_priv *nvchan; >> ? ? ? ?struct nouveau_device_priv *nvdev; >> ? ? ? ?struct drm_nouveau_channel_free cf; >> + ? ? ? int i; >> >> ? ? ? ?if (!chan || !*chan) >> ? ? ? ? ? ? ? ?return; >> @@ -115,6 +116,9 @@ nouveau_channel_free(struct nouveau_channel **chan) >> ? ? ? ?nouveau_bo_unmap(nvchan->notifier_bo); >> ? ? ? ?nouveau_bo_ref(NULL, &nvchan->notifier_bo); >> >> + ? ? ? for (i = 0; i < nvchan->drm.nr_subchan; i++) >> + ? ? ? ? ? ? ? free(nvchan->base.subc[i].gr); >> + >> ? ? ? ?nouveau_grobj_free(&nvchan->base.vram); >> ? ? ? ?nouveau_grobj_free(&nvchan->base.gart); >> ? ? ? ?nouveau_grobj_free(&nvchan->base.nullobj); >> -- >> 1.6.6.rc3 >> >> _______________________________________________ >> Nouveau mailing list >> Nouveau at lists.freedesktop.org >> http://lists.freedesktop.org/mailman/listinfo/nouveau >> >