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.64; helo=hqemgate15.nvidia.com; envelope-from=ashishsingha@nvidia.com; receiver=edk2-devel@lists.01.org Received: from hqemgate15.nvidia.com (hqemgate15.nvidia.com [216.228.121.64]) (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 831A9211B1117 for ; Sun, 6 Jan 2019 20:37:39 -0800 (PST) Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate15.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Sun, 06 Jan 2019 20:37:23 -0800 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Sun, 06 Jan 2019 20:37:38 -0800 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Sun, 06 Jan 2019 20:37:38 -0800 Received: from HQMAIL102.nvidia.com (172.18.146.10) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 7 Jan 2019 04:37:37 +0000 Received: from hqnvemgw01.nvidia.com (172.20.150.20) by HQMAIL102.nvidia.com (172.18.146.10) with Microsoft SMTP Server (TLS) id 15.0.1395.4 via Frontend Transport; Mon, 7 Jan 2019 04:37:37 +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 ; Sun, 06 Jan 2019 20:37:37 -0800 From: Ashish Singhal To: CC: Ashish Singhal Date: Sun, 6 Jan 2019 21:37:35 -0700 Message-ID: <05639709373c6eba5cd99764ad3d6d1facfcd727.1546835541.git.ashishsingha@nvidia.com> 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=1546835843; 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=DxWaGxukdF1qSk/9b1Eb9HY8HUFhN6ilsBkYsSAvBkfwAlmS2rFjMmrNyhFRQRS1c 6vlSgiz5rC8NYGHs31H2tELiQtbI/4eZ2i5QrH22V3WQijh/zBieTx7m5NNBTjXCJ1 Wz7MTMyUj7tFI16DxwQJhEKLWdX8osh/rTDSkwFWN1aRvISoMXl1wOph6ExWFNRrH4 bsY4WX51+EVPt4Vja8oBrs9MLJZ1Lrw4EgCa1+2dATr07REk12TL28LdDza1aZX7hZ FgXzFs8H1T0OLJ3wE3cNKQ4a3Vv73qC3DryinYbsrXuO5cV29y2HfqVz6xpfX3vkWY 6rOmyLUI//CZQ== Subject: [PATCH v3 2/2] 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: Mon, 07 Jan 2019 04:37:39 -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