From nobody Fri May 3 20:00:20 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1490146398043955.9036079051856; Tue, 21 Mar 2017 18:33:18 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id E0BF780424; Tue, 21 Mar 2017 18:33:16 -0700 (PDT) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 13B63803ED for ; Tue, 21 Mar 2017 18:33:16 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP; 21 Mar 2017 18:33:15 -0700 Received: from jiaxinwu-mobl2.ccr.corp.intel.com ([10.239.196.148]) by FMSMGA003.fm.intel.com with ESMTP; 21 Mar 2017 18:33:14 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,202,1486454400"; d="scan'208";a="837229328" From: Jiaxin Wu To: edk2-devel@lists.01.org Date: Wed, 22 Mar 2017 09:33:12 +0800 Message-Id: <1490146392-2804-1-git-send-email-jiaxin.wu@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.1 Subject: [edk2] [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: , Cc: Ye Ting , Zhang Lubo , Fu Siyuan , Wu Jiaxin MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Currently, error handling in IScsiDriverEntryPoint is incorrect. For example, if IScsiCreateAttempts() return error due to the limited max variable size, iSCSI will not unload the configuration entries. Cc: Zhang Lubo Cc: Ye Ting Cc: Fu Siyuan Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin Reviewed-by: Zhang Lubo --- NetworkPkg/IScsiDxe/IScsiDriver.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/NetworkPkg/IScsiDxe/IScsiDriver.c b/NetworkPkg/IScsiDxe/IScsiD= river.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, --=20 1.9.5.msysgit.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel