summaryrefslogtreecommitdiff
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorJiaxin Wu <jiaxin.wu@intel.com>2017-12-07 18:37:03 +0800
committerJiaxin Wu <jiaxin.wu@intel.com>2017-12-13 16:25:35 +0800
commit3fe97d9459f5235843e3570980ba7a189bafc812 (patch)
tree74a6d26daacd4e37216adc1e42a6846525bb062e /MdeModulePkg
parent19bf8314dc0187e1ccde0ccbd82b876722b8319e (diff)
downloadedk2-3fe97d9459f5235843e3570980ba7a189bafc812.zip
edk2-3fe97d9459f5235843e3570980ba7a189bafc812.tar.gz
edk2-3fe97d9459f5235843e3570980ba7a189bafc812.tar.bz2
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 <siyuan.fu@intel.com> Cc: Heyi Guo <heyi.guo@linaro.org> Cc: Ye Ting <ting.ye@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Tested-by: Heyi Guo <heyi.guo@linaro.org> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c
index 6d4f33f..4bfeaf3 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);