diff options
author | Wenyi Xie <xiewenyi2@huawei.com> | 2020-11-24 10:06:32 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2020-11-27 17:52:59 +0000 |
commit | f69a2b9a42029bcbcf88d074425ebe63495b0a08 (patch) | |
tree | 0bf5401c3b09516e32e50142210196ff1e639da2 /OvmfPkg/XenPvBlkDxe | |
parent | 73b604bb1e13ff915c523180979f7b4db34b6d1b (diff) | |
download | edk2-f69a2b9a42029bcbcf88d074425ebe63495b0a08.tar.gz edk2-f69a2b9a42029bcbcf88d074425ebe63495b0a08.tar.bz2 edk2-f69a2b9a42029bcbcf88d074425ebe63495b0a08.zip |
OvmfPkg/XenPvBlkDxe: add return value if allocting fail
return EFI_OUT_OF_RESOURCES if pool allocating fail.
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Julien Grall <julien@xen.org>
Signed-off-by: Wenyi Xie <xiewenyi2@huawei.com>
Message-Id: <1606183592-81879-2-git-send-email-xiewenyi2@huawei.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Diffstat (limited to 'OvmfPkg/XenPvBlkDxe')
-rw-r--r-- | OvmfPkg/XenPvBlkDxe/BlockFront.c | 4 |
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;
|