MdeModulePkg/MnpDxe: Fix EBC build hang issue.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
(cherry picked from commit 54d7177c78)
This commit is contained in:
Fu Siyuan
2017-06-02 13:17:17 +08:00
parent 0e3899bed8
commit 8f0dea41bc

View File

@@ -1,7 +1,7 @@
/** @file /** @file
Implementation of Managed Network Protocol private services. 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 This program and the accompanying materials
are licensed and made available under the terms and conditions are licensed and made available under the terms and conditions
of the BSD License which accompanies this distribution. The full of the BSD License which accompanies this distribution. The full
@@ -235,7 +235,7 @@ MnpAddFreeTxBuf (
Status = EFI_SUCCESS; Status = EFI_SUCCESS;
for (Index = 0; Index < Count; Index++) { 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) { if (TxBufWrap == NULL) {
DEBUG ((EFI_D_ERROR, "MnpAddFreeTxBuf: TxBuf Alloc failed.\n")); DEBUG ((EFI_D_ERROR, "MnpAddFreeTxBuf: TxBuf Alloc failed.\n"));