diff --git a/Kernel/Storage/NVMe/NVMeQueue.cpp b/Kernel/Storage/NVMe/NVMeQueue.cpp index 8871fce23e2..f61890c7c92 100644 --- a/Kernel/Storage/NVMe/NVMeQueue.cpp +++ b/Kernel/Storage/NVMe/NVMeQueue.cpp @@ -123,7 +123,7 @@ u16 NVMeQueue::submit_sync_sqe(NVMeSubmission& sub) SpinlockLocker lock(m_cq_lock); index = m_cq_head - 1; if (index < 0) - index = IO_QUEUE_SIZE - 1; + index = m_qdepth - 1; } cqe_cid = m_cqe_array[index].command_id; Scheduler::yield();