]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Dxe/Event/Event.c
MdeModulePkg/Core/Dxe/Gcd: remove set but not used variables
[mirror_edk2.git] / MdeModulePkg / Core / Dxe / Event / Event.c
index 1a25b171786f1b5f6910327df47fc59ba6ab7447..a8c4c34d83c9f0a98a6ab655b75db48eea9346cd 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   UEFI Event support functions implemented in this file.\r
 \r
-Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2014, 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
@@ -204,7 +204,7 @@ CoreDispatchEventNotifies (
     CoreAcquireEventLock ();\r
   }\r
 \r
-  gEventPending &= ~(1 << Priority);\r
+  gEventPending &= ~(UINTN)(1 << Priority);\r
   CoreReleaseEventLock ();\r
 }\r
 \r
@@ -673,6 +673,14 @@ CoreWaitForEvent (
     return EFI_UNSUPPORTED;\r
   }\r
 \r
+  if (NumberOfEvents == 0) {\r
+    return EFI_INVALID_PARAMETER;\r
+  }\r
+\r
+  if (UserEvents == NULL) {\r
+    return EFI_INVALID_PARAMETER;\r
+  }\r
+\r
   for(;;) {\r
 \r
     for(Index = 0; Index < NumberOfEvents; Index++) {\r
@@ -683,7 +691,9 @@ CoreWaitForEvent (
       // provide index of event that caused problem\r
       //\r
       if (Status != EFI_NOT_READY) {\r
-        *UserIndex = Index;\r
+        if (UserIndex != NULL) {\r
+          *UserIndex = Index;\r
+        }\r
         return Status;\r
       }\r
     }\r