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>main
parent
ca4971292c
commit
37ccce5e39
|
@ -100,12 +100,13 @@ nouveau_grobj_free(struct nouveau_grobj **grobj)
|
||||||
struct drm_nouveau_gpuobj_free f;
|
struct drm_nouveau_gpuobj_free f;
|
||||||
|
|
||||||
FIRE_RING(&chan->base);
|
FIRE_RING(&chan->base);
|
||||||
|
|
||||||
f.channel = chan->drm.channel;
|
f.channel = chan->drm.channel;
|
||||||
f.handle = nvgrobj->base.handle;
|
f.handle = nvgrobj->base.handle;
|
||||||
drmCommandWrite(nvdev->fd, DRM_NOUVEAU_GPUOBJ_FREE,
|
drmCommandWrite(nvdev->fd, DRM_NOUVEAU_GPUOBJ_FREE,
|
||||||
&f, sizeof(f));
|
&f, sizeof(f));
|
||||||
}
|
}
|
||||||
|
if (nvgrobj->base.bound != NOUVEAU_GROBJ_UNBOUND)
|
||||||
|
chan->base.subc[nvgrobj->base.subc].gr = NULL;
|
||||||
free(nvgrobj);
|
free(nvgrobj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue