From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from BLU004-OMC4S21.hotmail.com (blu004-omc4s21.hotmail.com [65.55.111.160]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id DE0C881C8C for ; Thu, 3 Nov 2016 16:10:58 -0700 (PDT) Received: from EUR01-DB5-obe.outbound.protection.outlook.com ([65.55.111.136]) by BLU004-OMC4S21.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.23008); Thu, 3 Nov 2016 16:11:00 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=lWoUz0V2aQy+3YXnxsKr0pobvSmTcp1SfPWjExD/PyE=; b=r+BpV2QpgZVVjld/z72XCBkMDa0/3/nqhcN554ZDbbc3z84mV7fgGvLpP6rDsaC8aGGIbC1/H+ANIIR4TmJ8t/CVyMJfdbJG8hnjSlt8KclKyHFf+EXG9tuwmHby10rL3Va9N4LnLn5+Do3ezwDxCLUZqHertnIwSnYaPR9y9oiw1B9MZ1UE/HXX96qcXFxvIAT5973DFNr9pNrQ7nO3hf8vRkshMlbW9NqwT6qBkMSUndSuKljjfUaY7trE6Al03fe7BgbYOk7VFIMNN/SpVHL8YR4wWD0ckX7ZR03xoLi9gE3ZN5WEZf6yc8u2f/4xQ0QDnKqGZ9BoEr/0OPqmCQ== Received: from VE1EUR01FT028.eop-EUR01.prod.protection.outlook.com (10.152.2.60) by VE1EUR01HT033.eop-EUR01.prod.protection.outlook.com (10.152.3.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.693.6; Thu, 3 Nov 2016 23:10:54 +0000 Received: from AM5PR0601MB2579.eurprd06.prod.outlook.com (10.152.2.56) by VE1EUR01FT028.mail.protection.outlook.com (10.152.2.220) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.693.6 via Frontend Transport; Thu, 3 Nov 2016 23:10:54 +0000 Received: from AM5PR0601MB2579.eurprd06.prod.outlook.com ([10.168.154.13]) by AM5PR0601MB2579.eurprd06.prod.outlook.com ([10.168.154.13]) with mapi id 15.01.0693.016; Thu, 3 Nov 2016 23:10:54 +0000 From: =?iso-8859-1?Q?Marvin_H=E4user?= To: "edk2-devel@lists.01.org" CC: "siyuan.fu@intel.com" , "jiaxin.wu@intel.com" Thread-Topic: [PATCH v2 2/2] NetworkPkg: Do not free memory during ExitBootServices (). Thread-Index: AQHSNieGnq2I3mND6UqtSkt/uJhYQA== Date: Thu, 3 Nov 2016 23:10:54 +0000 Message-ID: Accept-Language: de-DE, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: lists.01.org; dkim=none (message not signed) header.d=none;lists.01.org; dmarc=none action=none header.from=outlook.com; x-incomingtopheadermarker: OriginalChecksum:; UpperCasedChecksum:; SizeAsReceived:7124; Count:34 x-ms-exchange-messagesentrepresentingtype: 1 x-incomingheadercount: 34 x-eopattributedmessage: 0 x-microsoft-exchange-diagnostics: 1; VE1EUR01HT033; 7:/OcVp0XlnNM1KeHMFnqkGCM2UodFvI7zno0IHZ2zfyBczyDoQO3nPBeHc71XvjMSiIk02E8RHNQZnEER/c8fF4tTFdyAQxv+EV/4Oc5TDjjMj7A8FA2S7PUDuMv8mLT3YD0VsxfPcNci8BBsaJRFLyrFpdPZoLFyvoBFGdt6DFEE3VNaMQw/XhChBTcK9OQhVnc7VhfSG/boMlcPmx0TZsFv3iaHjVAV8sqsozKxSu1G7Cl8czehWbigc6v+lYcbnqhjGK0KNJGLJWSb5gjFzfP8zLaImSUO/E5gcoM5NISPAQvUDqUYWBSfwAqvFcYpy2EiUmVtT+Ir0FGisKOqYDmc9mPaNmnwCK+3kS33VdA= x-forefront-antispam-report: EFV:NLI; SFV:NSPM; SFS:(10019020)(98900003); DIR:OUT; SFP:1102; SCL:1; SRVR:VE1EUR01HT033; H:AM5PR0601MB2579.eurprd06.prod.outlook.com; FPR:; SPF:None; LANG:en; x-ms-office365-filtering-correlation-id: b1652e80-c802-474d-5017-08d4043ea8e6 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(1601124038)(1603103107)(1601125047); SRVR:VE1EUR01HT033; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(432015012)(82015046); SRVR:VE1EUR01HT033; BCL:0; PCL:0; RULEID:; SRVR:VE1EUR01HT033; x-forefront-prvs: 011579F31F spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Nov 2016 23:10:54.1197 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1EUR01HT033 X-OriginalArrivalTime: 03 Nov 2016 23:11:00.0165 (UTC) FILETIME=[8A740750:01D23627] Subject: [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: Thu, 03 Nov 2016 23:10:59 -0000 Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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 --- 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 --=20 2.10.1.windows.1