Cc: Fu Siyuan <[email protected]> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <[email protected]> --- MdeModulePkg/Universal/Network/MnpDxe/MnpConfig.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/MdeModulePkg/Universal/Network/MnpDxe/MnpConfig.c b/MdeModulePkg/Universal/Network/MnpDxe/MnpConfig.c index d1a4cb5..e24cb75 100644 --- a/MdeModulePkg/Universal/Network/MnpDxe/MnpConfig.c +++ b/MdeModulePkg/Universal/Network/MnpDxe/MnpConfig.c @@ -1,9 +1,9 @@ /** @file Implementation of Managed Network Protocol private services. -Copyright (c) 2005 - 2016, Intel Corporation. All rights reserved.<BR> +Copyright (c) 2005 - 2017, 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<BR> http://opensource.org/licenses/bsd-license.php @@ -233,11 +233,11 @@ MnpAddFreeTxBuf ( NET_CHECK_SIGNATURE (MnpDeviceData, MNP_DEVICE_DATA_SIGNATURE); ASSERT ((Count > 0) && (MnpDeviceData->BufferLength > 0)); Status = EFI_SUCCESS; for (Index = 0; Index < Count; Index++) { - TxBufWrap = (MNP_TX_BUF_WRAP*) AllocatePool (sizeof (MNP_TX_BUF_WRAP) + MnpDeviceData->BufferLength - 1); + TxBufWrap = (MNP_TX_BUF_WRAP*) AllocatePool (OFFSET_OF (MNP_TX_BUF_WRAP, TxBuf) + MnpDeviceData->BufferLength ); if (TxBufWrap == NULL) { DEBUG ((EFI_D_ERROR, "MnpAddFreeTxBuf: TxBuf Alloc failed.\n")); Status = EFI_OUT_OF_RESOURCES; break; -- 1.9.5.msysgit.1 _______________________________________________ edk2-devel mailing list [email protected] https://lists.01.org/mailman/listinfo/edk2-devel

