From 3fe97d9459f5235843e3570980ba7a189bafc812 Mon Sep 17 00:00:00 2001 From: Jiaxin Wu Date: Thu, 7 Dec 2017 18:37:03 +0800 Subject: [PATCH 1/1] MdeModulePkg/UefiPxeBcDxe: Discard the normal ICMP packets and recycle the received ICMP data. This patch is to discard the normal ICMP packets and recycle the received ICMP data to avoid the memory leak. Cc: Siyuan Fu Cc: Heyi Guo Cc: Ye Ting Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jiaxin Wu Tested-by: Heyi Guo Reviewed-by: Fu Siyuan --- .../Universal/Network/UefiPxeBcDxe/PxeBcImpl.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c index 6d4f33f0db..4bfeaf3d31 100644 --- a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c +++ b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c @@ -166,13 +166,15 @@ IcmpErrorListenHandlerDpc ( return; } - if (EFI_ERROR (Status) || (RxData == NULL)) { + if (RxData == NULL) { + goto Resume; + } + + if (Status != EFI_ICMP_ERROR) { // - // Only process the normal packets and the icmp error packets, if RxData is NULL - // with Status == EFI_SUCCESS or EFI_ICMP_ERROR, just resume the receive although - // this should be a bug of the low layer (IP). + // The return status should be recognized as EFI_ICMP_ERROR. // - goto Resume; + goto CleanUp; } if (EFI_IP4 (RxData->Header->SourceAddress) != 0 && @@ -216,8 +218,6 @@ IcmpErrorListenHandlerDpc ( CopiedPointer += CopiedLen; } - goto Resume; - CleanUp: gBS->SignalEvent (RxData->RecycleSignal); -- 2.39.2