public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v2 2/2] NetworkPkg: Do not free memory during ExitBootServices ().
@ 2016-11-03 23:10 Marvin Häuser
  2016-11-04  1:34 ` Zeng, Star
  0 siblings, 1 reply; 2+ messages in thread
From: Marvin Häuser @ 2016-11-03 23:10 UTC (permalink / raw)
  To: edk2-devel@lists.01.org; +Cc: siyuan.fu@intel.com, jiaxin.wu@intel.com

During exiting Boot Services, there should be no changes made to the
Memory Map. This patch eliminates explicit and implicit calls to the
Memory Allocation Services and, where applicable, zeros the memory
instead.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com>
---
 NetworkPkg/IScsiDxe/IScsiMisc.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/NetworkPkg/IScsiDxe/IScsiMisc.c b/NetworkPkg/IScsiDxe/IScsiMisc.c
index deebf5d9a387..0825e2a5e944 100644
--- a/NetworkPkg/IScsiDxe/IScsiMisc.c
+++ b/NetworkPkg/IScsiDxe/IScsiMisc.c
@@ -1486,10 +1486,19 @@ IScsiOnExitBootService (
   ISCSI_DRIVER_DATA *Private;
 
   Private = (ISCSI_DRIVER_DATA *) Context;
-  gBS->CloseEvent (Private->ExitBootServiceEvent);
 
   if (Private->Session != NULL) {
     IScsiSessionAbort (Private->Session);
+
+    //
+    // Empty Session as it will not be freed.
+    //
+    ZeroMem (Private->Session, sizeof (*Private->Session));
+
+    //
+    // Set Session to NULL so this code is not re-run.
+    //
+    Private->Session = NULL;
   }
 }
 
-- 
2.10.1.windows.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-11-04  1:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-03 23:10 [PATCH v2 2/2] NetworkPkg: Do not free memory during ExitBootServices () Marvin Häuser
2016-11-04  1:34 ` Zeng, Star

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox