]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/IScsiDxe/IScsiMisc.c
MdeModulePkg/IScsiDxe: Set ExitBootServiceEvent to NULL after close it.
[mirror_edk2.git] / MdeModulePkg / Universal / Network / IScsiDxe / IScsiMisc.c
index ae202c3fe24a1eb0cceee6693811878dc5056112..19577ff1824228b1cda773e55fa68b882687c71c 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Miscellaneous routines for iSCSI driver.\r
 \r
-Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2018, 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
@@ -624,9 +624,10 @@ IScsiCleanDriverData (
   }\r
 \r
 EXIT:\r
-\r
-  gBS->CloseEvent (Private->ExitBootServiceEvent);\r
-\r
+  if (Private->ExitBootServiceEvent != NULL) {\r
+    gBS->CloseEvent (Private->ExitBootServiceEvent);\r
+  }\r
+  \r
   FreePool (Private);\r
   return Status;\r
 }\r
@@ -872,7 +873,9 @@ IScsiOnExitBootService (
   ISCSI_DRIVER_DATA *Private;\r
 \r
   Private = (ISCSI_DRIVER_DATA *) Context;\r
+  \r
   gBS->CloseEvent (Private->ExitBootServiceEvent);\r
+  Private->ExitBootServiceEvent = NULL;\r
 \r
   IScsiSessionAbort (&Private->Session);\r
 }\r