From ef25ba07f12ae86054be0d5fbb4af1e5dafbab31 Mon Sep 17 00:00:00 2001 From: Mukul Joshi Date: Thu, 1 Sep 2022 16:37:02 -0400 Subject: [PATCH] libhsakmt: Remove potential double free in queue creation Remove potential double free condition when free_queue() is called after hsaKmtDestroyQueue() if mapping doorbell fails during queue creation. Signed-off-by: Mukul Joshi Change-Id: If2aa19c455b30d2940b232dbafb9cc1eaad721a5 [ROCm/ROCR-Runtime commit: 57a1c6f3ff43f5d0d7ce857ba0b1e4d9de15e480] --- projects/rocr-runtime/src/queues.c | 1 - 1 file changed, 1 deletion(-) diff --git a/projects/rocr-runtime/src/queues.c b/projects/rocr-runtime/src/queues.c index 20a1da4f61..6ea17b4a7d 100644 --- a/projects/rocr-runtime/src/queues.c +++ b/projects/rocr-runtime/src/queues.c @@ -662,7 +662,6 @@ HSAKMT_STATUS HSAKMTAPI hsaKmtCreateQueue(HSAuint32 NodeId, err = map_doorbell(NodeId, gpu_id, doorbell_mmap_offset); if (err != HSAKMT_STATUS_SUCCESS) { hsaKmtDestroyQueue(q->queue_id); - free_queue(q); return HSAKMT_STATUS_ERROR; }