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>
/** @file\r
Miscellaneous routines for iSCSI driver.\r
\r
/** @file\r
Miscellaneous routines for iSCSI driver.\r
\r
-Copyright (c) 2004 - 2017, 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
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
-\r
- gBS->CloseEvent (Private->ExitBootServiceEvent);\r
+ if (Private->ExitBootServiceEvent != NULL) {\r
+ gBS->CloseEvent (Private->ExitBootServiceEvent); \r
+ }\r
\r
mCallbackInfo->Current = NULL;\r
\r
\r
mCallbackInfo->Current = NULL;\r
\r
ISCSI_DRIVER_DATA *Private;\r
\r
Private = (ISCSI_DRIVER_DATA *) Context;\r
ISCSI_DRIVER_DATA *Private;\r
\r
Private = (ISCSI_DRIVER_DATA *) Context;\r
gBS->CloseEvent (Private->ExitBootServiceEvent);\r
gBS->CloseEvent (Private->ExitBootServiceEvent);\r
+ Private->ExitBootServiceEvent = NULL;\r
+ \r
if (Private->Session != NULL) {\r
IScsiSessionAbort (Private->Session);\r
}\r
if (Private->Session != NULL) {\r
IScsiSessionAbort (Private->Session);\r
}\r