]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c
free allocated memory in error handler.
[mirror_edk2.git] / MdeModulePkg / Bus / Usb / UsbKbDxe / KeyBoard.c
index 51ab18223e5ef2ce50fc64b655094bb29db95d3a..40f9a5633a6e1e247efcad107ea325ccaa7031dd 100644 (file)
@@ -598,6 +598,9 @@ SetKeyboardLayoutEvent (
   UINT8                     KeyCode;\r
 \r
   UsbKeyboardDevice = (USB_KB_DEV *) Context;\r
+  if (UsbKeyboardDevice->Signature != USB_KB_DEV_SIGNATURE) {\r
+    return;\r
+  }\r
 \r
   //\r
   // Try to get current keyboard layout from HII database\r