From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id E4E0F803BD for ; Tue, 21 Mar 2017 20:03:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1490151797; x=1521687797; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=e+KzeJGa/GtFF5LVXCu80EVZWLEbN6YKFba8RTmkep8=; b=J0A7yQy6xhUTtYdmyIBgjKAAn1D0Ioy00BbbLb9Qo48URh2y8ktDmrTS 88hHm+mWDSfeEKtsdZAzf9nXzOtkHw==; Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Mar 2017 20:03:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,202,1486454400"; d="scan'208";a="79659115" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga006.fm.intel.com with ESMTP; 21 Mar 2017 20:03:17 -0700 Received: from fmsmsx114.amr.corp.intel.com (10.18.116.8) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 21 Mar 2017 20:03:17 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX114.amr.corp.intel.com (10.18.116.8) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 21 Mar 2017 20:03:16 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.88]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.204]) with mapi id 14.03.0248.002; Wed, 22 Mar 2017 11:03:13 +0800 From: "Zhang, Lubo" To: "Wu, Jiaxin" , "edk2-devel@lists.01.org" CC: "Ye, Ting" , "Fu, Siyuan" , "Wu, Jiaxin" Thread-Topic: [edk2] [Patch] NetworkPkg/IScsiDxe: Fix the incorrect error handling in DriverEntryPoint Thread-Index: AQHSoqxNkUFVDoqgdEKFwZTP5Omop6GgLDag Date: Wed, 22 Mar 2017 03:03:12 +0000 Message-ID: <7619447B08B8F74DA4FF2A813B79803B39B050EA@shsmsx102.ccr.corp.intel.com> References: <1490146392-2804-1-git-send-email-jiaxin.wu@intel.com> In-Reply-To: <1490146392-2804-1-git-send-email-jiaxin.wu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch] NetworkPkg/IScsiDxe: Fix the incorrect error handling in DriverEntryPoint X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Mar 2017 03:03:18 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Zhang Lubo > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Ji= axin > Wu > Sent: Wednesday, March 22, 2017 9:33 AM > To: edk2-devel@lists.01.org > Cc: Ye, Ting ; Zhang, Lubo ; Fu, > Siyuan ; Wu, Jiaxin > Subject: [edk2] [Patch] NetworkPkg/IScsiDxe: Fix the incorrect error hand= ling in > DriverEntryPoint >=20 > Currently, error handling in IScsiDriverEntryPoint is incorrect. For exam= ple, if > IScsiCreateAttempts() return error due to the limited max variable size, = iSCSI will > not unload the configuration entries. >=20 > Cc: Zhang Lubo > Cc: Ye Ting > Cc: Fu Siyuan > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Wu Jiaxin > --- > NetworkPkg/IScsiDxe/IScsiDriver.c | 11 +++++++---- > 1 file changed, 7 insertions(+), 4 deletions(-) >=20 > diff --git a/NetworkPkg/IScsiDxe/IScsiDriver.c > b/NetworkPkg/IScsiDxe/IScsiDriver.c > index 269c1ae..2249919 100644 > --- a/NetworkPkg/IScsiDxe/IScsiDriver.c > +++ b/NetworkPkg/IScsiDxe/IScsiDriver.c > @@ -1811,11 +1811,11 @@ IScsiDriverEntryPoint ( > // > // Create Keywords for all the Attempts. > // > Status =3D IScsiCreateKeywords (PcdGet8 (PcdMaxIScsiAttemptNumber)); > if (EFI_ERROR (Status)) { > - goto Error5; > + goto Error6; > } >=20 > // > // There should be only one EFI_AUTHENTICATION_INFO_PROTOCOL. If > already exists, > // do not produce the protocol instance. > @@ -1838,17 +1838,20 @@ IScsiDriverEntryPoint ( > } >=20 > return EFI_SUCCESS; >=20 > Error6: > - IScsiConfigFormUnload (gIScsiIp4DriverBinding.DriverBindingHandle); > + IScsiCleanAttemptVariable (); >=20 > Error5: > - IScsiCleanAttemptVariable (); > + IScsiConfigFormUnload (gIScsiIp4DriverBinding.DriverBindingHandle); >=20 > Error4: > - FreePool (mPrivate); > + if (mPrivate !=3D NULL) { > + FreePool (mPrivate); > + mPrivate =3D NULL; > + } >=20 > Error3: > gBS->UninstallMultipleProtocolInterfaces ( > ImageHandle, > &gEfiIScsiInitiatorNameProtocolGuid, > -- > 1.9.5.msysgit.1 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel