[PATCH EDK2 v1 1/1] OvmfPkg/XenPvBlkDxe: add assert for pool allocating


wenyi,xie
 

add assert after pool allocating.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
Signed-off-by: Wenyi Xie <xiewenyi2@huawei.com>
---
OvmfPkg/XenPvBlkDxe/BlockFront.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/OvmfPkg/XenPvBlkDxe/BlockFront.c b/OvmfPkg/XenPvBlkDxe/BlockFront.c
index 122a6baed25a..bde385090832 100644
--- a/OvmfPkg/XenPvBlkDxe/BlockFront.c
+++ b/OvmfPkg/XenPvBlkDxe/BlockFront.c
@@ -155,6 +155,7 @@ XenPvBlockFrontInitialization (
ASSERT (NodeName != NULL);

Dev = AllocateZeroPool (sizeof (XEN_BLOCK_FRONT_DEVICE));
+ ASSERT (Dev != NULL);
Dev->Signature = XEN_BLOCK_FRONT_SIGNATURE;
Dev->NodeName = NodeName;
Dev->XenBusIo = XenBusIo;
--
2.20.1.windows.1

Join devel@edk2.groups.io to automatically receive all group messages.