diff options
author | Jiaxin Wu <jiaxin.wu@intel.com> | 2018-01-02 13:30:15 +0800 |
---|---|---|
committer | Jiaxin Wu <jiaxin.wu@intel.com> | 2018-01-10 08:33:15 +0800 |
commit | d32159853d4bd37a1f98312b172f3c426019cde2 (patch) | |
tree | a384e37b5c1924fa6f3f36cd5b34e80eaf3d0115 /MdeModulePkg | |
parent | 1e4725e569960b1107c11df6c404312d26129eab (diff) | |
download | edk2-d32159853d4bd37a1f98312b172f3c426019cde2.tar.gz edk2-d32159853d4bd37a1f98312b172f3c426019cde2.tar.bz2 edk2-d32159853d4bd37a1f98312b172f3c426019cde2.zip |
MdeModulePkg/IScsiDxe: Set ExitBootServiceEvent to NULL after close it.
v2:
* Refine the commit log.
There are two place to close the ISCSI ExitBootServiceEvent:
#1.IScsiOnExitBootService(), which is the callback function of
ExitBootServiceEvent.
#2.IScsiCleanDriverData(), which will be invoked by ISCSI driver
binding stop().
So, the ExitBootServiceEvent will be closed and freed when exit boot
server is triggered. But it may be closed and freed again in ISCSI driver
binding stop(), which will result in the issue recorded at
https://bugzilla.tianocore.org/show_bug.cgi?id=742.
This patch is to resolve the issue.
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Diffstat (limited to 'MdeModulePkg')
-rw-r--r-- | MdeModulePkg/Universal/Network/IScsiDxe/IScsiMisc.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiMisc.c b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiMisc.c index ae202c3fe2..19577ff182 100644 --- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiMisc.c +++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiMisc.c @@ -1,7 +1,7 @@ /** @file
Miscellaneous routines for iSCSI driver.
-Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -624,9 +624,10 @@ IScsiCleanDriverData ( }
EXIT:
-
- gBS->CloseEvent (Private->ExitBootServiceEvent);
-
+ if (Private->ExitBootServiceEvent != NULL) {
+ gBS->CloseEvent (Private->ExitBootServiceEvent);
+ }
+
FreePool (Private);
return Status;
}
@@ -872,7 +873,9 @@ IScsiOnExitBootService ( ISCSI_DRIVER_DATA *Private;
Private = (ISCSI_DRIVER_DATA *) Context;
+
gBS->CloseEvent (Private->ExitBootServiceEvent);
+ Private->ExitBootServiceEvent = NULL;
IScsiSessionAbort (&Private->Session);
}
|