2
0
mirror of https://git.missingno.dev/kolibrios-nvme-driver/ synced 2025-01-22 05:08:16 +01:00

delete I/O queues when cleanup is called

This commit is contained in:
Abdur-Rahman Mansoor 2024-08-08 12:49:56 -04:00
parent f502f3cfaa
commit 7be08b3e44

View File

@ -1254,6 +1254,7 @@ endp
proc nvme_cleanup
DEBUGF DBG_INFO, "nvme_cleanup called\n"
mov esi, dword [p_nvme_devices]
test esi, esi
jnz @f
@ -1276,10 +1277,19 @@ proc nvme_cleanup
.get_queue:
add edi, sizeof.NVM_QUEUE_ENTRY
; TODO: Delete the I/O completion and submission queue
; Remember, we have to free the completion queue before
; the submission queue
; TODO: Check if I/O completion and submission queue exist
; before deleting?
push ecx
test ecx, ecx
jz @f ; we don't want to delete the admin queue
push ecx
stdcall delete_io_completion_queue, esi, ecx
pop ecx
push ecx
stdcall delete_io_submission_queue, esi, ecx
pop ecx
@@:
invoke KernelFree, dword [edi + NVM_QUEUE_ENTRY.cq_ptr]
invoke KernelFree, dword [edi + NVM_QUEUE_ENTRY.sq_ptr]
pop ecx