From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=216.228.121.143; helo=hqemgate14.nvidia.com; envelope-from=ashishsingha@nvidia.com; receiver=edk2-devel@lists.01.org Received: from hqemgate14.nvidia.com (hqemgate14.nvidia.com [216.228.121.143]) (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 1339C211A6D31 for ; Fri, 4 Jan 2019 14:16:04 -0800 (PST) Received: from hqpgpgate102.nvidia.com (Not Verified[216.228.121.13]) by hqemgate14.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Fri, 04 Jan 2019 14:15:52 -0800 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate102.nvidia.com (PGP Universal service); Fri, 04 Jan 2019 14:16:03 -0800 X-PGP-Universal: processed; by hqpgpgate102.nvidia.com on Fri, 04 Jan 2019 14:16:03 -0800 Received: from HQMAIL110.nvidia.com (172.18.146.15) by HQMAIL106.nvidia.com (172.18.146.12) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Fri, 4 Jan 2019 22:16:03 +0000 Received: from HQMAIL107.nvidia.com (172.20.187.13) by hqmail110.nvidia.com (172.18.146.15) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Fri, 4 Jan 2019 22:16:02 +0000 Received: from hqnvemgw01.nvidia.com (172.20.150.20) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1395.4 via Frontend Transport; Fri, 4 Jan 2019 22:16:03 +0000 Received: from ashishsingha-lnx.nvidia.com (Not Verified[10.28.48.147]) by hqnvemgw01.nvidia.com with Trustwave SEG (v7, 5, 8, 10121) id ; Fri, 04 Jan 2019 14:16:03 -0800 From: Ashish Singhal To: CC: Ashish Singhal Date: Fri, 4 Jan 2019 15:15:58 -0700 Message-ID: X-Mailer: git-send-email 2.7.4 In-Reply-To: References: X-NVConfidentiality: public MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1546640152; bh=hGeS0SXMwugdkjtTd+3UL5YseCf9wcIA8ttRul+jYNY=; h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:X-NVConfidentiality:MIME-Version: Content-Type; b=VC+mKN1QBQ7vulAjIIpITbU6LcWHoegviFohR0YXD6kFN8GooowdfY0/IDLgVsf9L fM+PBvnxWopkdPkSVLbhoopdpdwvyB0iENP4+h0Gs8pqhs1voq+yiX8D/QsTMK4Bn4 OlyjGwqmSIR6fYh7vdZs9li7zwWvShllqy8NqHc1fsMIStw2gC7hsuIoanNK5F5fmi IQuaQjP84ERLxL0/U2umH/4V/kEHv8uJdS8LjUvrBbR5ToZ94jzRQn+E65DHpiXKy+ tehvd1Ldkwz+HdIkaD0iIxidkkJC0FED5ooD2iXiTGiqlKd5nVa7SG8QmsEkb6E0Lw HtFs1u7i3WV2g== Subject: [PATCH 2/4] NetworkPkg/IScsiDxe: Use UEFILib APIs to uninstall protocols. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jan 2019 22:16:04 -0000 Content-Type: text/plain During cleanup in case of initialization failure, some driver bindings are not installed. Using abstractions in UEFILib takes care of it. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1428 Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ashish Singhal --- NetworkPkg/IScsiDxe/IScsiDriver.c | 31 +++++++++++-------------------- 1 file changed, 11 insertions(+), 20 deletions(-) diff --git a/NetworkPkg/IScsiDxe/IScsiDriver.c b/NetworkPkg/IScsiDxe/IScsiDriver.c index 91176e6..8747de7 100644 --- a/NetworkPkg/IScsiDxe/IScsiDriver.c +++ b/NetworkPkg/IScsiDxe/IScsiDriver.c @@ -1,6 +1,7 @@ /** @file The entry point of IScsi driver. +Copyright (c) 2019, NVIDIA Corporation. All rights reserved. Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.
(C) Copyright 2017 Hewlett Packard Enterprise Development LP
@@ -1861,28 +1862,18 @@ Error3: ); Error2: - gBS->UninstallMultipleProtocolInterfaces ( - gIScsiIp6DriverBinding.DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, - &gIScsiIp6DriverBinding, - &gEfiComponentName2ProtocolGuid, - &gIScsiComponentName2, - &gEfiComponentNameProtocolGuid, - &gIScsiComponentName, - NULL - ); + EfiLibUninstallDriverBindingComponentName2 ( + &gIScsiIp6DriverBinding, + &gIScsiComponentName, + &gIScsiComponentName2 + ); Error1: - gBS->UninstallMultipleProtocolInterfaces ( - ImageHandle, - &gEfiDriverBindingProtocolGuid, - &gIScsiIp4DriverBinding, - &gEfiComponentName2ProtocolGuid, - &gIScsiComponentName2, - &gEfiComponentNameProtocolGuid, - &gIScsiComponentName, - NULL - ); + EfiLibUninstallDriverBindingComponentName2 ( + &gIScsiIp4DriverBinding, + &gIScsiComponentName, + &gIScsiComponentName2 + ); return Status; } -- 2.7.4