[igt-dev] [PATCH i-g-t] lib/i915/intel_memory_region: free query_info in gem_get_lmem_region_count

Ashutosh Dixit ashutosh.dixit at intel.com
Wed Jun 2 19:53:59 UTC 2021


query_info calloc'd in gem_get_query_memory_regions should be freed in
gem_get_lmem_region_count.

Cc: Andrzej Turko <andrzej.turko at linux.intel.com>
Cc: Zbigniew Kempczynski <zbigniew.kempczynski at intel.com>
Cc: Matthew Auld <matthew.auld at intel.com>
Fixes: f32993a2ed ("lib/i915/intel_memory_region: Add new memory region lib")
Signed-off-by: Ashutosh Dixit <ashutosh.dixit at intel.com>
---
 lib/i915/intel_memory_region.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/i915/intel_memory_region.c b/lib/i915/intel_memory_region.c
index 983ac4df07..144ae12ca7 100644
--- a/lib/i915/intel_memory_region.c
+++ b/lib/i915/intel_memory_region.c
@@ -149,6 +149,7 @@ uint8_t gem_get_lmem_region_count(int fd)
 		if (query_info->regions[i].region.memory_class == I915_MEMORY_CLASS_DEVICE)
 			lmem_regions += 1;
 	}
+	free(query_info);
 
 	return lmem_regions;
 }
-- 
2.31.1



More information about the igt-dev mailing list