* [PATCH to drm/nouveau] nouveau: Mark nouveau subchannel unbound nouveau_grobj_free
@ 2011-11-24 13:08 Maarten Lankhorst
[not found] ` <4ECE41E5.3090608-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Maarten Lankhorst @ 2011-11-24 13:08 UTC (permalink / raw)
To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Valgrind throws warns about a user-after-free if you try to bind a
new subchannel after the old one in that slot was freed,
so remove it from the channel list.
Signed-off-by: Maarten Lankhorst <m.b.lankhorst-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
--- a/nouveau/nouveau_grobj.c
+++ b/nouveau/nouveau_grobj.c
@@ -100,12 +99,13 @@ nouveau_grobj_free(struct nouveau_grobj **grobj)
struct drm_nouveau_gpuobj_free f;
FIRE_RING(&chan->base);
-
f.channel = chan->drm.channel;
f.handle = nvgrobj->base.handle;
drmCommandWrite(nvdev->fd, DRM_NOUVEAU_GPUOBJ_FREE,
&f, sizeof(f));
}
+ if (nvgrobj->base.bound != NOUVEAU_GROBJ_UNBOUND)
+ chan->base.subc[nvgrobj->base.subc].gr = NULL;
free(nvgrobj);
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH to drm/nouveau] nouveau: Mark nouveau subchannel unbound nouveau_grobj_free
[not found] ` <4ECE41E5.3090608-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2011-11-27 16:38 ` Younes Manton
0 siblings, 0 replies; 2+ messages in thread
From: Younes Manton @ 2011-11-27 16:38 UTC (permalink / raw)
To: Maarten Lankhorst; +Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
On Thu, Nov 24, 2011 at 8:08 AM, Maarten Lankhorst
<m.b.lankhorst-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Valgrind throws warns about a user-after-free if you try to bind a
> new subchannel after the old one in that slot was freed,
> so remove it from the channel list.
>
> Signed-off-by: Maarten Lankhorst <m.b.lankhorst-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>
> --- a/nouveau/nouveau_grobj.c
> +++ b/nouveau/nouveau_grobj.c
> @@ -100,12 +99,13 @@ nouveau_grobj_free(struct nouveau_grobj **grobj)
> struct drm_nouveau_gpuobj_free f;
>
> FIRE_RING(&chan->base);
> -
> f.channel = chan->drm.channel;
> f.handle = nvgrobj->base.handle;
> drmCommandWrite(nvdev->fd, DRM_NOUVEAU_GPUOBJ_FREE,
> &f, sizeof(f));
> }
> + if (nvgrobj->base.bound != NOUVEAU_GROBJ_UNBOUND)
> + chan->base.subc[nvgrobj->base.subc].gr = NULL;
> free(nvgrobj);
> }
>
>
>
> _______________________________________________
> Nouveau mailing list
> Nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
> http://lists.freedesktop.org/mailman/listinfo/nouveau
>
Pushed, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-11-27 16:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-24 13:08 [PATCH to drm/nouveau] nouveau: Mark nouveau subchannel unbound nouveau_grobj_free Maarten Lankhorst
[not found] ` <4ECE41E5.3090608-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2011-11-27 16:38 ` Younes Manton
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.