diff options
-rw-r--r-- | OvmfPkg/VirtioBlkDxe/VirtioBlk.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/OvmfPkg/VirtioBlkDxe/VirtioBlk.c b/OvmfPkg/VirtioBlkDxe/VirtioBlk.c index 6abd937..5a63986 100644 --- a/OvmfPkg/VirtioBlkDxe/VirtioBlk.c +++ b/OvmfPkg/VirtioBlkDxe/VirtioBlk.c @@ -260,6 +260,7 @@ SynchronousRequest ( EFI_PHYSICAL_ADDRESS HostStatusDeviceAddress;
EFI_PHYSICAL_ADDRESS RequestDeviceAddress;
EFI_STATUS Status;
+ EFI_STATUS UnmapStatus;
BlockSize = Dev->BlockIoMedia.BlockSize;
@@ -430,7 +431,13 @@ SynchronousRequest ( UnmapDataBuffer:
if (BufferSize > 0) {
- Dev->VirtIo->UnmapSharedBuffer (Dev->VirtIo, BufferMapping);
+ UnmapStatus = Dev->VirtIo->UnmapSharedBuffer (Dev->VirtIo, BufferMapping);
+ if (EFI_ERROR (UnmapStatus) && !RequestIsWrite && !EFI_ERROR (Status)) {
+ //
+ // Data from the bus master may not reach the caller; fail the request.
+ //
+ Status = EFI_DEVICE_ERROR;
+ }
}
UnmapRequestBuffer:
|