From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 9FEA681D65 for ; Thu, 3 Nov 2016 18:34:15 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 03 Nov 2016 18:34:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,589,1473145200"; d="scan'208";a="1054939707" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga001.jf.intel.com with ESMTP; 03 Nov 2016 18:34:17 -0700 Received: from fmsmsx101.amr.corp.intel.com (10.18.124.199) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 3 Nov 2016 18:34:16 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx101.amr.corp.intel.com (10.18.124.199) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 3 Nov 2016 18:34:16 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.206]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.139]) with mapi id 14.03.0248.002; Fri, 4 Nov 2016 09:34:14 +0800 From: "Zeng, Star" To: "Marvin.Haeuser@outlook.com" , "edk2-devel@lists.01.org" CC: "Fu, Siyuan" , "Wu, Jiaxin" , "Zeng, Star" Thread-Topic: [PATCH v2 2/2] NetworkPkg: Do not free memory during ExitBootServices (). Thread-Index: AQHSNieGnq2I3mND6UqtSkt/uJhYQKDICp3A Date: Fri, 4 Nov 2016 01:34:14 +0000 Message-ID: <0C09AFA07DD0434D9E2A0C6AEB04831039596212@shsmsx102.ccr.corp.intel.com> References: In-Reply-To: Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH v2 2/2] NetworkPkg: Do not free memory during ExitBootServices (). X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Nov 2016 01:34:15 -0000 Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Reviewed-by: Star Zeng -----Original Message----- From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Marv= in H?user Sent: Friday, November 4, 2016 7:11 AM To: edk2-devel@lists.01.org Cc: Fu, Siyuan ; Wu, Jiaxin Subject: [edk2] [PATCH v2 2/2] NetworkPkg: Do not free memory during ExitBo= otServices (). During exiting Boot Services, there should be no changes made to the Memory= Map. This patch eliminates explicit and implicit calls to the Memory Alloc= ation Services and, where applicable, zeros the memory instead. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Marvin Haeuser --- NetworkPkg/IScsiDxe/IScsiMisc.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/NetworkPkg/IScsiDxe/IScsiMisc.c b/NetworkPkg/IScsiDxe/IScsiMis= c.c index deebf5d9a387..0825e2a5e944 100644 --- a/NetworkPkg/IScsiDxe/IScsiMisc.c +++ b/NetworkPkg/IScsiDxe/IScsiMisc.c @@ -1486,10 +1486,19 @@ IScsiOnExitBootService ( ISCSI_DRIVER_DATA *Private; =20 Private =3D (ISCSI_DRIVER_DATA *) Context; - gBS->CloseEvent (Private->ExitBootServiceEvent); =20 if (Private->Session !=3D 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 =3D NULL; } } =20 -- 2.10.1.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel