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>
This commit is contained in:
Ashish Singhal 2019-01-11 03:27:08 +08:00 committed by Jiaxin Wu
parent 5bc96263ea
commit 22b35e8bd1
6 changed files with 35 additions and 70 deletions

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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 (

View File

@ -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;
}

View File

@ -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;