]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c
MdeModulePkg/NvmExpressDxe: Always copy CQ entry to PassThru packet
[mirror_edk2.git] / MdeModulePkg / Bus / Pci / NvmExpressDxe / NvmExpressPassthru.c
index bfcd3497949af1d2515e1e1a3a5ee986bb886931..c52e960771eff652fd276a4ad1404c4893aafc0d 100644 (file)
@@ -780,11 +780,6 @@ NvmExpressPassThru (
       Status = EFI_SUCCESS;\r
     } else {\r
       Status = EFI_DEVICE_ERROR;\r
-      //\r
-      // Copy the Respose Queue entry for this command to the callers response buffer\r
-      //\r
-      CopyMem(Packet->NvmeCompletion, Cq, sizeof(EFI_NVM_EXPRESS_COMPLETION));\r
-\r
       //\r
       // Dump every completion entry status for debugging.\r
       //\r
@@ -792,6 +787,10 @@ NvmExpressPassThru (
         NvmeDumpStatus(Cq);\r
       DEBUG_CODE_END();\r
     }\r
+    //\r
+    // Copy the Respose Queue entry for this command to the callers response buffer\r
+    //\r
+    CopyMem(Packet->NvmeCompletion, Cq, sizeof(EFI_NVM_EXPRESS_COMPLETION));\r
   } else {\r
     //\r
     // Timeout occurs for an NVMe command. Reset the controller to abort the\r