drm/nouveau: fix nouveau_mm/nouveau_mm_node leak
authorMarcin Slusarz <marcin.slusarz@gmail.com>
Sun, 21 Oct 2012 22:20:32 +0000 (00:20 +0200)
committerBen Skeggs <bskeggs@redhat.com>
Mon, 22 Oct 2012 02:25:53 +0000 (12:25 +1000)
v2: use already existing parent

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/core/core/gpuobj.c

index 1f34549..70586fd 100644 (file)
@@ -39,6 +39,11 @@ nouveau_gpuobj_destroy(struct nouveau_gpuobj *gpuobj)
                        nv_wo32(gpuobj, i, 0x00000000);
        }
 
+       if (gpuobj->node) {
+               nouveau_mm_free(&nv_gpuobj(gpuobj->parent)->heap,
+                               &gpuobj->node);
+       }
+
        if (gpuobj->heap.block_size)
                nouveau_mm_fini(&gpuobj->heap);