summaryrefslogtreecommitdiff
path: root/IntelFrameworkModulePkg/Csm/BiosThunk/VideoDxe
diff options
context:
space:
mode:
Diffstat (limited to 'IntelFrameworkModulePkg/Csm/BiosThunk/VideoDxe')
-rw-r--r--IntelFrameworkModulePkg/Csm/BiosThunk/VideoDxe/BiosVideo.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/IntelFrameworkModulePkg/Csm/BiosThunk/VideoDxe/BiosVideo.c b/IntelFrameworkModulePkg/Csm/BiosThunk/VideoDxe/BiosVideo.c
index 76591e7a47..f2ad95d9fc 100644
--- a/IntelFrameworkModulePkg/Csm/BiosThunk/VideoDxe/BiosVideo.c
+++ b/IntelFrameworkModulePkg/Csm/BiosThunk/VideoDxe/BiosVideo.c
@@ -712,6 +712,19 @@ BiosVideoChildHandleInstall (
if (EFI_ERROR (Status)) {
//
+ // Free GOP mode structure if it is not freed before
+ // VgaMiniPort does not need this structure any more
+ //
+ if (BiosVideoPrivate->GraphicsOutput.Mode != NULL) {
+ if (BiosVideoPrivate->GraphicsOutput.Mode->Info != NULL) {
+ FreePool (BiosVideoPrivate->GraphicsOutput.Mode->Info);
+ BiosVideoPrivate->GraphicsOutput.Mode->Info = NULL;
+ }
+ FreePool (BiosVideoPrivate->GraphicsOutput.Mode);
+ BiosVideoPrivate->GraphicsOutput.Mode = NULL;
+ }
+
+ //
// Neither VBE nor the standard 640x480 16 color VGA mode are supported, so do
// not produce the Graphics Output protocol. Instead, produce the VGA MiniPort Protocol.
//
@@ -993,8 +1006,10 @@ BiosVideoDeviceReleaseResource (
if (BiosVideoPrivate->GraphicsOutput.Mode != NULL) {
if (BiosVideoPrivate->GraphicsOutput.Mode->Info != NULL) {
FreePool (BiosVideoPrivate->GraphicsOutput.Mode->Info);
+ BiosVideoPrivate->GraphicsOutput.Mode->Info = NULL;
}
FreePool (BiosVideoPrivate->GraphicsOutput.Mode);
+ BiosVideoPrivate->GraphicsOutput.Mode = NULL;
}
//
// Free EDID discovered protocol occupied resource
@@ -1634,14 +1649,6 @@ Done:
BiosVideoPrivate->ModeData = NULL;
BiosVideoPrivate->MaxMode = 0;
}
- if (BiosVideoPrivate->GraphicsOutput.Mode != NULL) {
- if (BiosVideoPrivate->GraphicsOutput.Mode->Info != NULL) {
- FreePool (BiosVideoPrivate->GraphicsOutput.Mode->Info);
- BiosVideoPrivate->GraphicsOutput.Mode->Info = NULL;
- }
- FreePool (BiosVideoPrivate->GraphicsOutput.Mode);
- BiosVideoPrivate->GraphicsOutput.Mode= NULL;
- }
if (EdidOverrideDataBlock != NULL) {
FreePool (EdidOverrideDataBlock);
}