From: Dave Airlie Date: Tue, 8 Dec 2009 05:58:08 +0000 (+1000) Subject: drm/ttm: fix memory leak noticed by kmemleak. X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=ec42a6e7dcfc2e9a92fad1c132bc9e110fafeb3f;p=deliverable%2Flinux.git drm/ttm: fix memory leak noticed by kmemleak. If we don't need the zone we need to free it. Acked-By: Thomas Hellstrom Signed-off-by: Dave Airlie --- diff --git a/drivers/gpu/drm/ttm/ttm_memory.c b/drivers/gpu/drm/ttm/ttm_memory.c index 8bfde5f40841..f5245c02b8fd 100644 --- a/drivers/gpu/drm/ttm/ttm_memory.c +++ b/drivers/gpu/drm/ttm/ttm_memory.c @@ -323,8 +323,10 @@ static int ttm_mem_init_dma32_zone(struct ttm_mem_global *glob, * No special dma32 zone needed. */ - if (mem <= ((uint64_t) 1ULL << 32)) + if (mem <= ((uint64_t) 1ULL << 32)) { + kfree(zone); return 0; + } /* * Limit max dma32 memory to 4GB for now