]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c
Remove SafeFreePool from MemoryAllocationLib as this API's name is misleading. Its...
[mirror_edk2.git] / MdeModulePkg / Bus / Usb / UsbKbDxe / KeyBoard.c
index d2bac53a529503284bf8b95095a5d22cd0624c06..b608f65367a17bb9616ddb1eac8eda8cda0f0c2e 100644 (file)
@@ -651,7 +651,9 @@ ReleaseKeyboardLayoutResources (
   USB_NS_KEY      *UsbNsKey;\r
   LIST_ENTRY      *Link;\r
 \r
-  SafeFreePool (UsbKeyboardDevice->KeyConvertionTable);\r
+  if (UsbKeyboardDevice->KeyConvertionTable != NULL) {\r
+    FreePool (UsbKeyboardDevice->KeyConvertionTable);\r
+  }\r
   UsbKeyboardDevice->KeyConvertionTable = NULL;\r
 \r
   while (!IsListEmpty (&UsbKeyboardDevice->NsKeyList)) {\r
@@ -659,8 +661,8 @@ ReleaseKeyboardLayoutResources (
     UsbNsKey = USB_NS_KEY_FORM_FROM_LINK (Link);\r
     RemoveEntryList (&UsbNsKey->Link);\r
 \r
-    gBS->FreePool (UsbNsKey->NsKey);\r
-    gBS->FreePool (UsbNsKey);\r
+    FreePool (UsbNsKey->NsKey);\r
+    FreePool (UsbNsKey);\r
   }\r
 }\r
 \r