diff --git a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c index ef3d772cc2..fb80f39ce8 100644 --- a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c +++ b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c @@ -603,7 +603,7 @@ NvmExpressPassThru ( Private->SqTdbl[QueueId].Sqt ^= 1; } Data = ReadUnaligned32 ((UINT32*)&Private->SqTdbl[QueueId]); - PciIo->Mem.Write ( + Status = PciIo->Mem.Write ( PciIo, EfiPciIoWidthUint32, NVME_BAR, @@ -612,6 +612,10 @@ NvmExpressPassThru ( &Data ); + if (EFI_ERROR (Status)) { + goto EXIT; + } + // // For non-blocking requests, return directly if the command is placed // in the submission queue. @@ -695,7 +699,7 @@ NvmExpressPassThru ( } Data = ReadUnaligned32 ((UINT32*)&Private->CqHdbl[QueueId]); - PciIo->Mem.Write ( + Status = PciIo->Mem.Write ( PciIo, EfiPciIoWidthUint32, NVME_BAR,