mirror of https://github.com/acidanthera/audk.git
MdeModulePkg: Freed the received packet buffer if it is not expected.
* When the packet is not normal packet or icmp error packet, the code does not recycle it by signal RecycleSignal event, and this will result some memory leak. This patch is to fix this issue. Cc: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wang Fan <fan.wang@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
This commit is contained in:
parent
c74805f1e7
commit
0a1bd0a35d
|
@ -1039,12 +1039,22 @@ IpIoListenHandlerDpc (
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (((EFI_SUCCESS != Status) && (EFI_ICMP_ERROR != Status)) || (NULL == RxData)) {
|
if ((EFI_SUCCESS != Status) && (EFI_ICMP_ERROR != Status)) {
|
||||||
//
|
//
|
||||||
// @bug Only process the normal packets and the icmp error packets, if RxData is NULL
|
// Only process the normal packets and the icmp error packets.
|
||||||
// @bug with Status == EFI_SUCCESS or EFI_ICMP_ERROR, just resume the receive although
|
|
||||||
// @bug this should be a bug of the low layer (IP).
|
|
||||||
//
|
//
|
||||||
|
if (RxData != NULL) {
|
||||||
|
goto CleanUp;
|
||||||
|
} else {
|
||||||
|
goto Resume;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// if RxData is NULL with Status == EFI_SUCCESS or EFI_ICMP_ERROR, this should be a code issue in the low layer (IP).
|
||||||
|
//
|
||||||
|
ASSERT (RxData != NULL);
|
||||||
|
if (RxData == NULL) {
|
||||||
goto Resume;
|
goto Resume;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue