diff options
author | Dave Airlie <airlied@redhat.com> | 2009-12-08 15:58:08 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-12-09 13:29:37 +1000 |
commit | ec42a6e7dcfc2e9a92fad1c132bc9e110fafeb3f (patch) | |
tree | 7f7afc4f2ca0366fea7c8b1926dcc91db6acb9b8 /drivers/gpu/drm/ttm | |
parent | b16d9acbdb97452d1418420e069acf7381ef10bb (diff) | |
download | blackbird-op-linux-ec42a6e7dcfc2e9a92fad1c132bc9e110fafeb3f.tar.gz blackbird-op-linux-ec42a6e7dcfc2e9a92fad1c132bc9e110fafeb3f.zip |
drm/ttm: fix memory leak noticed by kmemleak.
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>
Diffstat (limited to 'drivers/gpu/drm/ttm')
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_memory.c | 4 |
1 files changed, 3 insertions, 1 deletions
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 |