public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [patch] MdeModulePkg/MnpDxe: Fix EBC build hang issue
@ 2017-06-02  5:05 Dandan Bi
  2017-06-02  5:11 ` Fu, Siyuan
  0 siblings, 1 reply; 2+ messages in thread
From: Dandan Bi @ 2017-06-02  5:05 UTC (permalink / raw)
  To: edk2-devel; +Cc: Fu Siyuan

Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
---
 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



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch] MdeModulePkg/MnpDxe: Fix EBC build hang issue
  2017-06-02  5:05 [patch] MdeModulePkg/MnpDxe: Fix EBC build hang issue Dandan Bi
@ 2017-06-02  5:11 ` Fu, Siyuan
  0 siblings, 0 replies; 2+ messages in thread
From: Fu, Siyuan @ 2017-06-02  5:11 UTC (permalink / raw)
  To: Bi, Dandan, edk2-devel@lists.01.org


Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>


-----Original Message-----
From: Bi, Dandan 
Sent: 2017年6月2日 13:05
To: edk2-devel@lists.01.org
Cc: Fu, Siyuan <siyuan.fu@intel.com>
Subject: [patch] MdeModulePkg/MnpDxe: Fix EBC build hang issue

Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
---
 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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-06-02  5:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-02  5:05 [patch] MdeModulePkg/MnpDxe: Fix EBC build hang issue Dandan Bi
2017-06-02  5:11 ` Fu, Siyuan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox