From 543fe60c969662ed5c4b1dcedd77bd8968eae48e Mon Sep 17 00:00:00 2001 From: Graham Sider Date: Wed, 12 Apr 2023 15:04:14 -0400 Subject: [PATCH] libhsakmt: Fix queue destroy SVM path free size Use q->total_mem_alloc_size for munmap in SVM codepath of free_queue. Signed-off-by: Graham Sider Change-Id: I2fecaa1ddb337b1fe71f9cbba45a0c9467eff0c0 [ROCm/ROCR-Runtime commit: ae659e5427e9e479de03319db862c57e7d4b700f] --- projects/rocr-runtime/src/queues.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/projects/rocr-runtime/src/queues.c b/projects/rocr-runtime/src/queues.c index 9e29fe15f8..0f3b71c755 100644 --- a/projects/rocr-runtime/src/queues.c +++ b/projects/rocr-runtime/src/queues.c @@ -445,8 +445,7 @@ static void free_queue(struct queue *q) q->eop_buffer_size, PAGE_SIZE, q->use_ats); if (q->unified_ctx_save_restore) - munmap(q->ctx_save_restore, - PAGE_ALIGN_UP(q->ctx_save_restore_size + q->debug_memory_size)); + munmap(q->ctx_save_restore, q->total_mem_alloc_size); else if (q->ctx_save_restore) free_exec_aligned_memory(q->ctx_save_restore, q->total_mem_alloc_size,