Skip to content

Commit

Permalink
drm/ttm: fix memory leak noticed by kmemleak.
Browse files Browse the repository at this point in the history
If we don't need the zone we need to free it.

Acked-By: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
  • Loading branch information
Dave Airlie committed Dec 9, 2009
1 parent b16d9ac commit ec42a6e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/gpu/drm/ttm/ttm_memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ec42a6e

Please sign in to comment.