MdeModulePkg: Fix DHCP4 driver hang issue in some case.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17653 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Wu Jiaxin 2015-06-18 00:48:35 +00:00 committed by jiaxinwu
parent ce96473329
commit 35bc88dddc
1 changed files with 14 additions and 1 deletions

View File

@ -1,6 +1,6 @@
/** @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
@ -718,6 +718,19 @@ 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);