public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Zeng, Star" <star.zeng@intel.com>
To: "Marvin.Haeuser@outlook.com" <Marvin.Haeuser@outlook.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Fu, Siyuan" <siyuan.fu@intel.com>,
	"Wu, Jiaxin" <jiaxin.wu@intel.com>,
	"Zeng, Star" <star.zeng@intel.com>
Subject: Re: [PATCH v2 2/2] NetworkPkg: Do not free memory during ExitBootServices ().
Date: Fri, 4 Nov 2016 01:34:14 +0000	[thread overview]
Message-ID: <0C09AFA07DD0434D9E2A0C6AEB04831039596212@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <AM5PR0601MB257981BA80A4D7B17424F9B380A30@AM5PR0601MB2579.eurprd06.prod.outlook.com>

Reviewed-by: Star Zeng <star.zeng@intel.com>

-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Marvin H?user
Sent: Friday, November 4, 2016 7:11 AM
To: edk2-devel@lists.01.org
Cc: Fu, Siyuan <siyuan.fu@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com>
Subject: [edk2] [PATCH v2 2/2] NetworkPkg: Do not free memory during ExitBootServices ().

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

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


      reply	other threads:[~2016-11-04  1:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0C09AFA07DD0434D9E2A0C6AEB04831039596212@shsmsx102.ccr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox