/** @file\r
Helper functions for USB Keyboard Driver.\r
\r
-Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
// Handle repeat key\r
//\r
KeyDescriptor = GetKeyDescriptor (UsbKeyboardDevice, CurKeyCodeBuffer[Index]);\r
- ASSERT (KeyDescriptor != NULL);\r
+ if (KeyDescriptor == NULL) {\r
+ continue;\r
+ }\r
\r
if (KeyDescriptor->Modifier == EFI_NUM_LOCK_MODIFIER || KeyDescriptor->Modifier == EFI_CAPS_LOCK_MODIFIER) {\r
//\r
Dequeue (&UsbKeyboardDevice->UsbKeyQueue, &UsbKey, sizeof (UsbKey));\r
\r
KeyDescriptor = GetKeyDescriptor (UsbKeyboardDevice, UsbKey.KeyCode);\r
- ASSERT (KeyDescriptor != NULL);\r
-\r
+ if (KeyDescriptor == NULL) {\r
+ continue;\r
+ }\r
if (!UsbKey.Down) {\r
//\r
// Key is released.\r
// KeyCode must in the range of [0x4, 0x65] or [0xe0, 0xe7].\r
//\r
KeyDescriptor = GetKeyDescriptor (UsbKeyboardDevice, KeyCode);\r
- ASSERT (KeyDescriptor != NULL);\r
+ if (KeyDescriptor == NULL) {\r
+ return EFI_DEVICE_ERROR;\r
+ }\r
\r
if (KeyDescriptor->Modifier == EFI_NS_KEY_MODIFIER) {\r
//\r