X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FUniversal%2FNetwork%2FTcp4Dxe%2FTcp4Driver.c;h=1eefb38f915309e29b5ca723f56a0be26e9c425b;hp=002cd61089522776129dbe9b42dc43c5d0219d3d;hb=e5e12de7d0a67111060c77723df39885c91a8ea5;hpb=4eb65aff715faafd9040c6fc85a5d59e22343978 diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.c b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.c index 002cd61089..1eefb38f91 100644 --- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.c +++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.c @@ -143,7 +143,6 @@ Tcp4DestroyTimer ( mTcp4Timer.TimerEvent = NULL; } -//@MT: EFI_DRIVER_ENTRY_POINT (Tcp4DriverEntryPoint) EFI_STATUS EFIAPI @@ -306,7 +305,7 @@ Tcp4DriverBindingStart ( // NetZeroMem (&OpenData, sizeof (IP_IO_OPEN_DATA)); - CopyMem (&OpenData.IpConfigData, &mIpIoDefaultIpConfigData, sizeof (EFI_IP4_CONFIG_DATA)); + CopyMem (&OpenData.IpConfigData, &mIpIoDefaultIpConfigData, sizeof (OpenData.IpConfigData)); OpenData.IpConfigData.DefaultProtocol = EFI_IP_PROTO_TCP; OpenData.PktRcvdNotify = Tcp4RxCallback; @@ -587,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: @@ -653,6 +674,16 @@ Tcp4ServiceBindingDestroyChild ( Status = SockDestroyChild (Sock); + // + // Close the device path protocol + // + gBS->CloseProtocol ( + TcpServiceData->ControllerHandle, + &gEfiDevicePathProtocolGuid, + TcpServiceData->DriverBindingHandle, + ChildHandle + ); + // // Close the Ip4 protocol. //