]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCodeRouterSmm.c
When status code handler unregister itself, status code dispatch in status code route...
[mirror_edk2.git] / MdeModulePkg / Universal / ReportStatusCodeRouter / Smm / ReportStatusCodeRouterSmm.c
index ef1bd4d2e8c85f8cf01c1e0c7c187313c849755f..79c8d1e36f95ae27538d5b23dfee02d48b43fc96 100644 (file)
@@ -2,7 +2,7 @@
   Report Status Code Router Driver which produces SMM Report Stataus Code Handler Protocol\r
   and SMM Status Code Protocol.\r
 \r
-  Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2009 - 2011, 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
@@ -165,9 +165,12 @@ ReportDispatcher (
     return EFI_DEVICE_ERROR;\r
   }\r
 \r
-  for (Link = GetFirstNode (&mCallbackListHead); !IsNull (&mCallbackListHead, Link); Link = GetNextNode (&mCallbackListHead, Link)) {\r
+  for (Link = GetFirstNode (&mCallbackListHead); !IsNull (&mCallbackListHead, Link);) {\r
     CallbackEntry = CR (Link, SMM_RSC_HANDLER_CALLBACK_ENTRY, Node, SMM_RSC_HANDLER_CALLBACK_ENTRY_SIGNATURE);\r
-\r
+    //\r
+    // The handler may remove itself, so get the next handler in advance.\r
+    //\r
+    Link = GetNextNode (&mCallbackListHead, Link);\r
     CallbackEntry->RscHandlerCallback (\r
                      Type,\r
                      Value,\r