diff options
author | Wang Fan <fan.wang@intel.com> | 2018-01-03 18:11:04 +0800 |
---|---|---|
committer | Fu Siyuan <siyuan.fu@intel.com> | 2018-01-11 17:08:33 +0800 |
commit | ceec363801849327aba6d39b1a809f9a9272f3ce (patch) | |
tree | d6444983878803bb8702305ae3e8ada97a37e979 /NetworkPkg/Udp6Dxe/Udp6Driver.c | |
parent | 0f333664833319991972d0c12b0978bbd837fde7 (diff) | |
download | edk2-ceec363801849327aba6d39b1a809f9a9272f3ce.tar.gz edk2-ceec363801849327aba6d39b1a809f9a9272f3ce.tar.bz2 edk2-ceec363801849327aba6d39b1a809f9a9272f3ce.zip |
NetworkPkg: Add more parameter or return status check in UDP6 driver
In UDP6Dxe, there are several places that may be enhanced
to check input parameters and returned status. This patch
is to fix these issues.
Cc: Ye Ting <ting.ye@intel.com>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wang Fan <fan.wang@intel.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
Diffstat (limited to 'NetworkPkg/Udp6Dxe/Udp6Driver.c')
-rw-r--r-- | NetworkPkg/Udp6Dxe/Udp6Driver.c | 48 |
1 files changed, 27 insertions, 21 deletions
diff --git a/NetworkPkg/Udp6Dxe/Udp6Driver.c b/NetworkPkg/Udp6Dxe/Udp6Driver.c index 6dde1fc07e..f9d528e68f 100644 --- a/NetworkPkg/Udp6Dxe/Udp6Driver.c +++ b/NetworkPkg/Udp6Dxe/Udp6Driver.c @@ -290,18 +290,15 @@ Udp6DriverBindingStop ( NULL
);
} else if (IsListEmpty (&Udp6Service->ChildrenList)) {
- gBS->UninstallMultipleProtocolInterfaces (
- NicHandle,
- &gEfiUdp6ServiceBindingProtocolGuid,
- &Udp6Service->ServiceBinding,
- NULL
- );
+ Status = gBS->UninstallMultipleProtocolInterfaces (
+ NicHandle,
+ &gEfiUdp6ServiceBindingProtocolGuid,
+ &Udp6Service->ServiceBinding,
+ NULL
+ );
Udp6CleanService (Udp6Service);
-
FreePool (Udp6Service);
-
- Status = EFI_SUCCESS;
}
return Status;
@@ -510,21 +507,30 @@ Udp6ServiceBindingDestroyChild ( //
// Close the Ip6 protocol on the default IpIo.
//
- gBS->CloseProtocol (
- Udp6Service->IpIo->ChildHandle,
- &gEfiIp6ProtocolGuid,
- gUdp6DriverBinding.DriverBindingHandle,
- Instance->ChildHandle
- );
+ Status = gBS->CloseProtocol (
+ Udp6Service->IpIo->ChildHandle,
+ &gEfiIp6ProtocolGuid,
+ gUdp6DriverBinding.DriverBindingHandle,
+ Instance->ChildHandle
+ );
+ if (EFI_ERROR (Status)) {
+ Instance->InDestroy = FALSE;
+ return Status;
+ }
+
//
// Close the Ip6 protocol on this instance's IpInfo.
//
- gBS->CloseProtocol (
- Instance->IpInfo->ChildHandle,
- &gEfiIp6ProtocolGuid,
- gUdp6DriverBinding.DriverBindingHandle,
- Instance->ChildHandle
- );
+ Status = gBS->CloseProtocol (
+ Instance->IpInfo->ChildHandle,
+ &gEfiIp6ProtocolGuid,
+ gUdp6DriverBinding.DriverBindingHandle,
+ Instance->ChildHandle
+ );
+ if (EFI_ERROR (Status)) {
+ Instance->InDestroy = FALSE;
+ return Status;
+ }
//
// Uninstall the Udp6Protocol previously installed on the ChildHandle.
|