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>
This commit is contained in:
Wenyi Xie 2020-11-24 10:06:32 +08:00 committed by mergify[bot]
parent 73b604bb1e
commit f69a2b9a42
1 changed files with 4 additions and 0 deletions

View File

@ -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;