From 0322ed7af8a739263fd27e5ae1862b2b8f7137a5 Mon Sep 17 00:00:00 2001 From: gikidy Date: Fri, 26 Dec 2008 09:22:38 +0000 Subject: [PATCH] Check Library usage. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7141 6f19259b-4bc3-4df7-8a09-765794883524 --- .../Console/GraphicsConsoleDxe/GraphicsConsole.c | 12 +++++++----- 1 file 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); } }