2
0
mirror of https://git.missingno.dev/kolibrios-nvme-driver/ synced 2024-11-10 02:20:27 +01:00

fix(nvme_readwrite): free allocated PRP list after I/O command completion

This commit is contained in:
Abdur-Rahman Mansoor 2024-07-21 14:21:10 -04:00
parent 7e71c33f3f
commit 1599185ef4

View File

@ -712,6 +712,13 @@ proc nvme_readwrite stdcall, ns:dword, buf:dword, start_sector:qword, numsectors
ecx, \
dword [ebx + 8]
; free PRP list (if allocated)
mov eax, dword [ebx + 16]
test eax, eax
jz @f
invoke KernelFree, eax
@@:
; assume command completes successfully for now
xor eax, eax
jmp .end
@ -1128,10 +1135,10 @@ proc nvme_init stdcall, pci:dword
test eax, eax
jz .exit_fail
mov edx, NVM_CMD_READ
mov dword [eax], 23
mov dword [eax], 24
stdcall nvme_readwrite, [esi + pcidev.nsinfo], edi, 0x1000, 0, eax
DEBUGF DBG_INFO, "STRING: %s\n", edi
add edi, 0x1fe0
add edi, 0x1000
DEBUGF DBG_INFO, "STRING: %s\n", edi
end if
DEBUGF DBG_INFO, "nvme%u: Successfully initialized driver\n", [esi + pcidev.num]