diff options
Diffstat (limited to 'OvmfPkg/QemuVideoDxe/Initialize.c')
-rw-r--r-- | OvmfPkg/QemuVideoDxe/Initialize.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/OvmfPkg/QemuVideoDxe/Initialize.c b/OvmfPkg/QemuVideoDxe/Initialize.c index 305797bd50..37744786cb 100644 --- a/OvmfPkg/QemuVideoDxe/Initialize.c +++ b/OvmfPkg/QemuVideoDxe/Initialize.c @@ -176,6 +176,9 @@ QemuVideoCirrusModeSetup ( Private->ModeData = AllocatePool (
sizeof (Private->ModeData[0]) * QEMU_VIDEO_CIRRUS_MODE_COUNT
);
+ if (Private->ModeData == NULL) {
+ return EFI_OUT_OF_RESOURCES;
+ }
ModeData = Private->ModeData;
VideoMode = &QemuVideoCirrusModes[0];
for (Index = 0; Index < QEMU_VIDEO_CIRRUS_MODE_COUNT; Index ++) {
@@ -228,6 +231,9 @@ QemuVideoBochsModeSetup ( Private->ModeData = AllocatePool (
sizeof (Private->ModeData[0]) * QEMU_VIDEO_BOCHS_MODE_COUNT
);
+ if (Private->ModeData == NULL) {
+ return EFI_OUT_OF_RESOURCES;
+ }
ModeData = Private->ModeData;
VideoMode = &QemuVideoBochsModes[0];
for (Index = 0; Index < QEMU_VIDEO_BOCHS_MODE_COUNT; Index ++) {
|