summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c
diff options
context:
space:
mode:
Diffstat (limited to 'MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c')
-rw-r--r--MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c
index 407eefb5ba..eaf13d4229 100644
--- a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c
+++ b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c
@@ -763,10 +763,12 @@ CheckModeSupported (
EFI_STATUS Status;
UINTN SizeOfInfo;
EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *Info;
+ UINT32 MaxMode;
- Status = EFI_SUCCESS;
-
- for (ModeNumber = 0; ModeNumber < GraphicsOutput->Mode->MaxMode; ModeNumber++) {
+ Status = EFI_SUCCESS;
+ MaxMode = GraphicsOutput->Mode->MaxMode;
+
+ for (ModeNumber = 0; ModeNumber < MaxMode; ModeNumber++) {
Status = GraphicsOutput->QueryMode (
GraphicsOutput,
ModeNumber,
@@ -778,11 +780,11 @@ CheckModeSupported (
(Info->VerticalResolution == VerticalResolution)) {
Status = GraphicsOutput->SetMode (GraphicsOutput, ModeNumber);
if (!EFI_ERROR (Status)) {
- gBS->FreePool (Info);
+ FreePool (Info);
break;
}
}
- gBS->FreePool (Info);
+ FreePool (Info);
}
}