aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaarten Lankhorst2011-11-24 07:08:53 -0600
committerYounes Manton2011-11-27 11:28:20 -0600
commit37ccce5e390a9d757474920f488cafa1cf89854a (patch)
tree1cba89c028e2b25975a649f52fdb48f85615c7b4 /nouveau
parentca4971292cf99e0063416cd1c3467af94637bf2b (diff)
downloadlibdrm-37ccce5e390a9d757474920f488cafa1cf89854a.tar.gz
libdrm-37ccce5e390a9d757474920f488cafa1cf89854a.tar.xz
libdrm-37ccce5e390a9d757474920f488cafa1cf89854a.zip
nouveau: Mark nouveau subchannel unbound nouveau_grobj_free
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@gmail.com>
Diffstat (limited to 'nouveau')
-rw-r--r--nouveau/nouveau_grobj.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/nouveau/nouveau_grobj.c b/nouveau/nouveau_grobj.c
index c6b98f16..36344b99 100644
--- a/nouveau/nouveau_grobj.c
+++ b/nouveau/nouveau_grobj.c
@@ -100,12 +100,13 @@ nouveau_grobj_free(struct nouveau_grobj **grobj)
100 struct drm_nouveau_gpuobj_free f; 100 struct drm_nouveau_gpuobj_free f;
101 101
102 FIRE_RING(&chan->base); 102 FIRE_RING(&chan->base);
103
104 f.channel = chan->drm.channel; 103 f.channel = chan->drm.channel;
105 f.handle = nvgrobj->base.handle; 104 f.handle = nvgrobj->base.handle;
106 drmCommandWrite(nvdev->fd, DRM_NOUVEAU_GPUOBJ_FREE, 105 drmCommandWrite(nvdev->fd, DRM_NOUVEAU_GPUOBJ_FREE,
107 &f, sizeof(f)); 106 &f, sizeof(f));
108 } 107 }
108 if (nvgrobj->base.bound != NOUVEAU_GROBJ_UNBOUND)
109 chan->base.subc[nvgrobj->base.subc].gr = NULL;
109 free(nvgrobj); 110 free(nvgrobj);
110} 111}
111 112