diff --git a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c index bfcd349794..c52e960771 100644 --- a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c +++ b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c @@ -780,11 +780,6 @@ NvmExpressPassThru ( Status = EFI_SUCCESS; } else { Status = EFI_DEVICE_ERROR; - // - // Copy the Respose Queue entry for this command to the callers response buffer - // - CopyMem(Packet->NvmeCompletion, Cq, sizeof(EFI_NVM_EXPRESS_COMPLETION)); - // // Dump every completion entry status for debugging. // @@ -792,6 +787,10 @@ NvmExpressPassThru ( NvmeDumpStatus(Cq); DEBUG_CODE_END(); } + // + // Copy the Respose Queue entry for this command to the callers response buffer + // + CopyMem(Packet->NvmeCompletion, Cq, sizeof(EFI_NVM_EXPRESS_COMPLETION)); } else { // // Timeout occurs for an NVMe command. Reset the controller to abort the