summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAshish Singhal <ashishsingha@nvidia.com>2019-01-11 03:27:08 +0800
committerJiaxin Wu <Jiaxin.wu@intel.com>2019-01-14 13:12:17 +0800
commit22b35e8bd1f9aea7bbab3a26e8ab4df339454463 (patch)
tree2cc519dbe8bc2010da25f5c75eec949f49b09d13
parent5bc96263ea2bfecb07deea81c68a6c3e226ebda1 (diff)
downloadedk2-22b35e8bd1f9aea7bbab3a26e8ab4df339454463.tar.gz
edk2-22b35e8bd1f9aea7bbab3a26e8ab4df339454463.tar.bz2
edk2-22b35e8bd1f9aea7bbab3a26e8ab4df339454463.zip
NetworkPkg: Protocol Uninstallation Cleanup
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 <ashishsingha@nvidia.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
-rw-r--r--NetworkPkg/DnsDxe/DnsDriver.c30
-rw-r--r--NetworkPkg/HttpBootDxe/HttpBootDxe.c15
-rw-r--r--NetworkPkg/HttpDxe/HttpDriver.c15
-rw-r--r--NetworkPkg/IpSecDxe/IpSecDriver.c15
-rw-r--r--NetworkPkg/TcpDxe/TcpDriver.c15
-rw-r--r--NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c15
6 files changed, 35 insertions, 70 deletions
diff --git a/NetworkPkg/DnsDxe/DnsDriver.c b/NetworkPkg/DnsDxe/DnsDriver.c
index 1f9b924c0b..b74f5ba18e 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 7ec06f960d..0b16f9564c 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 8df984db41..979d76dcb4 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 f66f89a439..3082d997b7 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 2d4b16cd9e..00d172b019 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 0ab640beca..f25c27a94b 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;