summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--OvmfPkg/XenPvBlkDxe/BlockFront.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/OvmfPkg/XenPvBlkDxe/BlockFront.c b/OvmfPkg/XenPvBlkDxe/BlockFront.c
index 122a6baed2..14f9cc85b3 100644
--- a/OvmfPkg/XenPvBlkDxe/BlockFront.c
+++ b/OvmfPkg/XenPvBlkDxe/BlockFront.c
@@ -155,6 +155,10 @@ XenPvBlockFrontInitialization (
ASSERT (NodeName != NULL);
Dev = AllocateZeroPool (sizeof (XEN_BLOCK_FRONT_DEVICE));
+ if (Dev == NULL) {
+ return EFI_OUT_OF_RESOURCES;
+ }
+
Dev->Signature = XEN_BLOCK_FRONT_SIGNATURE;
Dev->NodeName = NodeName;
Dev->XenBusIo = XenBusIo;