From: Marcin Slusarz Date: Sun, 21 Oct 2012 22:20:32 +0000 (+0200) Subject: drm/nouveau: fix nouveau_mm/nouveau_mm_node leak X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=92485cef52c2de0f98efdf527ea39cef2b9fc416;p=openwrt%2Fstaging%2Fblogic.git drm/nouveau: fix nouveau_mm/nouveau_mm_node leak v2: use already existing parent Signed-off-by: Marcin Slusarz Signed-off-by: Ben Skeggs --- diff --git a/drivers/gpu/drm/nouveau/core/core/gpuobj.c b/drivers/gpu/drm/nouveau/core/core/gpuobj.c index 1f34549aff18..70586fde69cf 100644 --- a/drivers/gpu/drm/nouveau/core/core/gpuobj.c +++ b/drivers/gpu/drm/nouveau/core/core/gpuobj.c @@ -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);