Discussion:
[edk2] [Patch 2/2] Fix Dhcp4 driver hang issue in some case, which is caused by the driver does not free instance UdpIo before destroy its child.
jiaxinwu
2015-06-04 08:03:05 UTC
Permalink
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <***@intel.com>
Signed-off-by: jiaxinwu <***@intel.com>
---
MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Driver.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Driver.c b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Driver.c
index d1bba30..9253df2 100644
--- a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Driver.c
+++ b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Driver.c
@@ -1,8 +1,8 @@
/** @file

-Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php

@@ -716,10 +716,23 @@ Dhcp4ServiceBindingDestroyChild (
}

RemoveEntryList (&Instance->Link);
DhcpSb->NumChildren--;

+ if (Instance->UdpIo != NULL) {
+ UdpIoCleanIo (Instance->UdpIo);
+ gBS->CloseProtocol (
+ Instance->UdpIo->UdpHandle,
+ &gEfiUdp4ProtocolGuid,
+ Instance->Service->Image,
+ Instance->Handle
+ );
+ UdpIoFreeIo (Instance->UdpIo);
+ Instance->UdpIo = NULL;
+ Instance->Token = NULL;
+ }
+
gBS->RestoreTPL (OldTpl);

FreePool (Instance);
return EFI_SUCCESS;
}
--
1.9.5.msysgit.1



------------------------------------------------------------------------------
Loading...