summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/BdsDxe/Hotkey.c
diff options
context:
space:
mode:
Diffstat (limited to 'MdeModulePkg/Universal/BdsDxe/Hotkey.c')
-rw-r--r--MdeModulePkg/Universal/BdsDxe/Hotkey.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/MdeModulePkg/Universal/BdsDxe/Hotkey.c b/MdeModulePkg/Universal/BdsDxe/Hotkey.c
index 96ce6d7238..9efba6d730 100644
--- a/MdeModulePkg/Universal/BdsDxe/Hotkey.c
+++ b/MdeModulePkg/Universal/BdsDxe/Hotkey.c
@@ -23,10 +23,8 @@ VOID *mHotkeyRegistration;
/**
-
Check if the Key Option is valid or not.
-
@param KeyOption The Hot Key Option to be checked.
@retval TRUE The Hot Key Option is valid.
@@ -67,15 +65,14 @@ IsKeyOptionValid (
}
/**
-
Create Key#### for the given hotkey.
-
@param KeyOption The Hot Key Option to be added.
@param KeyOptionNumber The key option number for Key#### (optional).
@retval EFI_SUCCESS Register hotkey successfully.
@retval EFI_INVALID_PARAMETER The hotkey option is invalid.
+ @retval EFI_OUT_OF_RESOURCES Fail to allocate memory resource.
**/
EFI_STATUS
@@ -110,7 +107,6 @@ RegisterHotkey (
//
// check whether HotKey conflict with keys used by Setup Browser
//
-
KeyOrder = BdsLibGetVariableAndSize (
VAR_KEY_ORDER,
&gEfiGlobalVariableGuid,
@@ -187,7 +183,7 @@ RegisterHotkey (
KeyOption
);
if (EFI_ERROR (Status)) {
- gBS->FreePool (KeyOrder);
+ FreePool (KeyOrder);
return Status;
}
@@ -201,6 +197,7 @@ RegisterHotkey (
NewKeyOrder = AllocatePool (KeyOrderSize);
if (NewKeyOrder == NULL) {
+ FreePool (KeyOrder);
return EFI_OUT_OF_RESOURCES;
}
@@ -307,11 +304,10 @@ UnregisterHotkey (
This is the common notification function for HotKeys, it will be registered
with SimpleTextInEx protocol interface - RegisterKeyNotify() of ConIn handle.
-
@param KeyData A pointer to a buffer that is filled in with the keystroke
information for the key that was pressed.
- @retval EFI_SUCCESS KeyData is successfully processed.
+ @retval EFI_SUCCESS KeyData is successfully processed.
**/
EFI_STATUS
@@ -427,10 +423,8 @@ HotkeyCallback (
}
/**
-
Register the common HotKey notify function to given SimpleTextInEx protocol instance.
-
@param SimpleTextInEx Simple Text Input Ex protocol instance
@retval EFI_SUCCESS Register hotkey notification function successfully.
@@ -481,12 +475,9 @@ HotkeyRegisterNotify (
/**
Callback function for SimpleTextInEx protocol install events
-
@param Event the event that is signaled.
@param Context not used here.
- @return VOID
-
**/
VOID
EFIAPI
@@ -528,14 +519,12 @@ HotkeyEvent (
}
/**
-
Insert Key Option to hotkey list.
-
@param KeyOption The Hot Key Option to be added to hotkey list.
- @retval EFI_SUCCESS Add to hotkey list success.
-
+ @retval EFI_SUCCESS Add to hotkey list success.
+ @retval EFI_OUT_OF_RESOURCES Fail to allocate memory resource.
**/
EFI_STATUS
HotkeyInsertList (