summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Bus
diff options
context:
space:
mode:
authoreric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>2009-08-24 06:24:24 +0000
committereric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>2009-08-24 06:24:24 +0000
commit16a97771adb0678d5e22935a091aebfbfbd3f071 (patch)
treec44a6c6362a759f145cd1b1757e9286f7a9c7be0 /MdeModulePkg/Bus
parent95ba3c4150701418aa0806597fdc2e3099b62f79 (diff)
downloadedk2-platforms-16a97771adb0678d5e22935a091aebfbfbd3f071.tar.xz
free allocated memory in error handler.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9173 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Bus')
-rw-r--r--MdeModulePkg/Bus/Usb/UsbKbDxe/EfiKey.c6
-rw-r--r--MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c3
2 files changed, 9 insertions, 0 deletions
diff --git a/MdeModulePkg/Bus/Usb/UsbKbDxe/EfiKey.c b/MdeModulePkg/Bus/Usb/UsbKbDxe/EfiKey.c
index da6ce75b3a..b8a665cff5 100644
--- a/MdeModulePkg/Bus/Usb/UsbKbDxe/EfiKey.c
+++ b/MdeModulePkg/Bus/Usb/UsbKbDxe/EfiKey.c
@@ -394,6 +394,12 @@ ErrorExit:
if (UsbKeyboardDevice->SimpleInputEx.WaitForKeyEx != NULL) {
gBS->CloseEvent (UsbKeyboardDevice->SimpleInputEx.WaitForKeyEx);
}
+ if (UsbKeyboardDevice->KeyboardLayoutEvent != NULL) {
+ gBS->CloseEvent (UsbKeyboardDevice->KeyboardLayoutEvent);
+ }
+ if (UsbKeyboardDevice->KeyConvertionTable != NULL) {
+ FreePool (UsbKeyboardDevice->KeyConvertionTable);
+ }
FreePool (UsbKeyboardDevice);
UsbKeyboardDevice = NULL;
}
diff --git a/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c b/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c
index 51ab18223e..40f9a5633a 100644
--- a/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c
+++ b/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c
@@ -598,6 +598,9 @@ SetKeyboardLayoutEvent (
UINT8 KeyCode;
UsbKeyboardDevice = (USB_KB_DEV *) Context;
+ if (UsbKeyboardDevice->Signature != USB_KB_DEV_SIGNATURE) {
+ return;
+ }
//
// Try to get current keyboard layout from HII database