Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ec42a6e7 authored by Dave Airlie's avatar Dave Airlie
Browse files

drm/ttm: fix memory leak noticed by kmemleak.



If we don't need the zone we need to free it.

Acked-By: default avatarThomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent b16d9acb
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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