diff options
author | li-elvin <li-elvin@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-08-01 07:18:24 +0000 |
---|---|---|
committer | li-elvin <li-elvin@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-08-01 07:18:24 +0000 |
commit | af00cab88d24a30466f0a90ca32f80bc6d2eba14 (patch) | |
tree | baf56a99d977b3a17ca7b382e643a1a9f531c5ef /IntelFrameworkModulePkg | |
parent | fbf82a2cf22e0073b3a221629562184b129925ac (diff) | |
download | edk2-platforms-af00cab88d24a30466f0a90ca32f80bc6d2eba14.tar.xz |
Put free the buffer GraphicsOutput.Mode in correct place.
Signed-off-by: li-elvin
Reviewed-by: niruiyu
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12065 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'IntelFrameworkModulePkg')
-rw-r--r-- | IntelFrameworkModulePkg/Csm/BiosThunk/VideoDxe/BiosVideo.c | 23 |
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);
}
|