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.65; helo=hqemgate16.nvidia.com; envelope-from=ashishsingha@nvidia.com; receiver=edk2-devel@lists.01.org Received: from hqemgate16.nvidia.com (hqemgate16.nvidia.com [216.228.121.65]) (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 6C09D211B6968 for ; Thu, 10 Jan 2019 11:27:15 -0800 (PST) Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate16.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Thu, 10 Jan 2019 11:26:49 -0800 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Thu, 10 Jan 2019 11:27:14 -0800 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Thu, 10 Jan 2019 11:27:14 -0800 Received: from HQMAIL110.nvidia.com (172.18.146.15) by HQMAIL108.nvidia.com (172.18.146.13) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 10 Jan 2019 19:27:14 +0000 Received: from HQMAIL103.nvidia.com (172.20.187.11) by hqmail110.nvidia.com (172.18.146.15) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 10 Jan 2019 19:27:13 +0000 Received: from hqnvemgw01.nvidia.com (172.20.150.20) by HQMAIL103.nvidia.com (172.20.187.11) with Microsoft SMTP Server (TLS) id 15.0.1395.4 via Frontend Transport; Thu, 10 Jan 2019 19:27:13 +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 ; Thu, 10 Jan 2019 11:27:13 -0800 From: Ashish Singhal To: CC: , , Ashish Singhal Date: Thu, 10 Jan 2019 12:27:08 -0700 Message-ID: <2d3d928f7698138685701e6de58c083f65acafa4.1547148192.git.ashishsingha@nvidia.com> X-Mailer: git-send-email 2.7.4 X-NVConfidentiality: public MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1547148409; bh=zBFwSMEXHrgA/82og3KmcKxx5kyOli/8Z13ls6KJ/w8=; h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: X-NVConfidentiality:MIME-Version:Content-Type; b=EPVOmnZM7VVrlbshBWW4QGstgrrs75IUKrlmusrwNpoO2tT2UGYOI8AfsdTc7wpxI y2laIFD9uPWj/EDvtdwWmcLK6iGJZHe40MhvnUZ4OAv2bi1cGEKbM+pyXwStTR1Xmi XccgBLe5yRqgRHva6D0iOWlrD9M7ktqt2OgbuORvkTS6bQr1v+2r7ZZfxh8NjcuOBG 2hlDr/OD3eyheykpLtU/PRzLI8X9yyltpB5elib5SkRKqVCsJVMqaDzIHypU6y1Bpv RdzH43dt+iNq8M7aCG+jjXmHRXF95WwNXpmwbR+5RtMUiMIaB9jnW0yyjVZrdSWCUR IIFWME2ONtxMA== Subject: [PATCH] NetworkPkg: Protocol Uninstallation Cleanup 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: Thu, 10 Jan 2019 19:27:15 -0000 Content-Type: text/plain Use UEFILib provided protocol uninstallation abstraction instead of direct API for a proper cleanup. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1444 Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ashish Singhal --- NetworkPkg/DnsDxe/DnsDriver.c | 30 ++++++++++-------------------- NetworkPkg/HttpBootDxe/HttpBootDxe.c | 15 +++++---------- NetworkPkg/HttpDxe/HttpDriver.c | 15 +++++---------- NetworkPkg/IpSecDxe/IpSecDriver.c | 15 +++++---------- NetworkPkg/TcpDxe/TcpDriver.c | 15 +++++---------- NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c | 15 +++++---------- 6 files changed, 35 insertions(+), 70 deletions(-) diff --git a/NetworkPkg/DnsDxe/DnsDriver.c b/NetworkPkg/DnsDxe/DnsDriver.c index 1f9b924..b74f5ba 100644 --- a/NetworkPkg/DnsDxe/DnsDriver.c +++ b/NetworkPkg/DnsDxe/DnsDriver.c @@ -510,28 +510,18 @@ DnsDriverEntryPoint ( FreePool (mDriverData); Error2: - gBS->UninstallMultipleProtocolInterfaces ( - gDns6DriverBinding.DriverBindingHandle, - &gEfiDriverBindingProtocolGuid, - &gDns6DriverBinding, - &gEfiComponentName2ProtocolGuid, - &gDnsComponentName2, - &gEfiComponentNameProtocolGuid, - &gDnsComponentName, - NULL - ); + EfiLibUninstallDriverBindingComponentName2 ( + &gDns6DriverBinding, + &gDnsComponentName, + &gDnsComponentName2 + ); Error1: - gBS->UninstallMultipleProtocolInterfaces ( - ImageHandle, - &gEfiDriverBindingProtocolGuid, - &gDns4DriverBinding, - &gEfiComponentName2ProtocolGuid, - &gDnsComponentName2, - &gEfiComponentNameProtocolGuid, - &gDnsComponentName, - NULL - ); + EfiLibUninstallDriverBindingComponentName2 ( + &gDns4DriverBinding, + &gDnsComponentName, + &gDnsComponentName2 + ); return Status; } diff --git a/NetworkPkg/HttpBootDxe/HttpBootDxe.c b/NetworkPkg/HttpBootDxe/HttpBootDxe.c index 7ec06f960..0b16f95 100644 --- a/NetworkPkg/HttpBootDxe/HttpBootDxe.c +++ b/NetworkPkg/HttpBootDxe/HttpBootDxe.c @@ -1327,16 +1327,11 @@ HttpBootDxeDriverEntryPoint ( &gHttpBootDxeComponentName2 ); if (EFI_ERROR (Status)) { - gBS->UninstallMultipleProtocolInterfaces( - ImageHandle, - &gEfiDriverBindingProtocolGuid, - &gHttpBootIp4DxeDriverBinding, - &gEfiComponentName2ProtocolGuid, - &gHttpBootDxeComponentName2, - &gEfiComponentNameProtocolGuid, - &gHttpBootDxeComponentName, - NULL - ); + EfiLibUninstallDriverBindingComponentName2( + &gHttpBootIp4DxeDriverBinding, + &gHttpBootDxeComponentName, + &gHttpBootDxeComponentName2 + ); } return Status; } diff --git a/NetworkPkg/HttpDxe/HttpDriver.c b/NetworkPkg/HttpDxe/HttpDriver.c index 8df984d..979d76d 100644 --- a/NetworkPkg/HttpDxe/HttpDriver.c +++ b/NetworkPkg/HttpDxe/HttpDriver.c @@ -230,16 +230,11 @@ HttpDxeDriverEntryPoint ( &gHttpDxeComponentName2 ); if (EFI_ERROR (Status)) { - gBS->UninstallMultipleProtocolInterfaces ( - ImageHandle, - &gEfiDriverBindingProtocolGuid, - &gHttpDxeIp4DriverBinding, - &gEfiComponentName2ProtocolGuid, - &gHttpDxeComponentName2, - &gEfiComponentNameProtocolGuid, - &gHttpDxeComponentName, - NULL - ); + EfiLibUninstallDriverBindingComponentName2 ( + &gHttpDxeIp4DriverBinding, + &gHttpDxeComponentName, + &gHttpDxeComponentName2 + ); } return Status; } diff --git a/NetworkPkg/IpSecDxe/IpSecDriver.c b/NetworkPkg/IpSecDxe/IpSecDriver.c index f66f89a..3082d99 100644 --- a/NetworkPkg/IpSecDxe/IpSecDriver.c +++ b/NetworkPkg/IpSecDxe/IpSecDriver.c @@ -631,16 +631,11 @@ IpSecDriverEntryPoint ( return Status; ON_UNINSTALL_IPSEC4_DB: - gBS->UninstallMultipleProtocolInterfaces ( - ImageHandle, - &gEfiDriverBindingProtocolGuid, - &gIpSec4DriverBinding, - &gEfiComponentName2ProtocolGuid, - &gIpSecComponentName2, - &gEfiComponentNameProtocolGuid, - &gIpSecComponentName, - NULL - ); + EfiLibUninstallDriverBindingComponentName2 ( + &gIpSec4DriverBinding, + &gIpSecComponentName, + &gIpSecComponentName2 + ); ON_UNINSTALL_IPSEC: gBS->UninstallProtocolInterface ( diff --git a/NetworkPkg/TcpDxe/TcpDriver.c b/NetworkPkg/TcpDxe/TcpDriver.c index 2d4b16c..00d172b 100644 --- a/NetworkPkg/TcpDxe/TcpDriver.c +++ b/NetworkPkg/TcpDxe/TcpDriver.c @@ -202,16 +202,11 @@ TcpDriverEntryPoint ( &gTcpComponentName2 ); if (EFI_ERROR (Status)) { - gBS->UninstallMultipleProtocolInterfaces ( - ImageHandle, - &gEfiDriverBindingProtocolGuid, - &gTcp4DriverBinding, - &gEfiComponentName2ProtocolGuid, - &gTcpComponentName2, - &gEfiComponentNameProtocolGuid, - &gTcpComponentName, - NULL - ); + EfiLibUninstallDriverBindingComponentName2 ( + &gTcp4DriverBinding, + &gTcpComponentName, + &gTcpComponentName2 + ); return Status; } diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c b/NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c index 0ab640b..f25c27a 100644 --- a/NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c +++ b/NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c @@ -1269,16 +1269,11 @@ PxeBcDriverEntryPoint ( &gPxeBcComponentName2 ); if (EFI_ERROR (Status)) { - gBS->UninstallMultipleProtocolInterfaces ( - ImageHandle, - &gEfiDriverBindingProtocolGuid, - &gPxeBcIp4DriverBinding, - &gEfiComponentName2ProtocolGuid, - &gPxeBcComponentName2, - &gEfiComponentNameProtocolGuid, - &gPxeBcComponentName, - NULL - ); + EfiLibUninstallDriverBindingComponentName2 ( + &gPxeBcIp4DriverBinding, + &gPxeBcComponentName, + &gPxeBcComponentName2 + ); } return Status; -- 2.7.4