pixel: sscd: Fix memory leaks during SSCD generation Dangling FW_CORE_DUMP leaks ~1M, CONTEXTS another 64B. Bug: 332885803 Test: kmemleak no longer reports these leaks. Change-Id: Iee92089781374c4200cff44bce4d9561a868f450 Signed-off-by: Varad Gautam <varadgautam@google.com>
diff --git a/mali_kbase/platform/pixel/pixel_gpu_sscd.c b/mali_kbase/platform/pixel/pixel_gpu_sscd.c index cdcb1f0..ba38c53 100644 --- a/mali_kbase/platform/pixel/pixel_gpu_sscd.c +++ b/mali_kbase/platform/pixel/pixel_gpu_sscd.c
@@ -553,7 +553,8 @@ kfree(segments[PM_EVENT_LOG].addr); kfree(segments[KTRACE].addr); #if MALI_USE_CSF - pixel_context_snapshot_term(segments); + pixel_context_snapshot_term(&segments[CONTEXTS]); + kfree(segments[FW_CORE_DUMP].addr); #endif /* Null out the pointers */ memset(segments, 0, sizeof(struct sscd_segment) * NUM_SEGMENTS);