X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FUniversal%2FNetwork%2FTcp4Dxe%2FTcp4Driver.c;h=1eefb38f915309e29b5ca723f56a0be26e9c425b;hp=3ae8a2091cb9f4cff48941d411856002719f59fc;hb=e5e12de7d0a67111060c77723df39885c91a8ea5;hpb=98376cc51df0c0bd92a3436ec3309401d98c84e3;ds=inline diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.c b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.c index 3ae8a2091c..1eefb38f91 100644 --- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.c +++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.c @@ -586,6 +586,28 @@ Tcp4ServiceBindingCreateChild ( ); if (EFI_ERROR (Status)) { SockDestroyChild (Sock); + goto ON_EXIT; + } + + // + // Open the device path on the handle where service binding resides on. + // + Status = gBS->OpenProtocol ( + TcpServiceData->ControllerHandle, + &gEfiDevicePathProtocolGuid, + (VOID **) &Sock->ParentDevicePath, + TcpServiceData->DriverBindingHandle, + Sock->SockHandle, + EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER + ); + if (EFI_ERROR (Status)) { + gBS->CloseProtocol ( + TcpServiceData->IpIo->ChildHandle, + &gEfiIp4ProtocolGuid, + TcpServiceData->DriverBindingHandle, + Sock->SockHandle + ); + SockDestroyChild (Sock); } ON_EXIT: @@ -652,6 +674,16 @@ Tcp4ServiceBindingDestroyChild ( Status = SockDestroyChild (Sock); + // + // Close the device path protocol + // + gBS->CloseProtocol ( + TcpServiceData->ControllerHandle, + &gEfiDevicePathProtocolGuid, + TcpServiceData->DriverBindingHandle, + ChildHandle + ); + // // Close the Ip4 protocol. //