summaryrefslogtreecommitdiffstats
path: root/src/usr/fapi2/plat_attr_override_sync.C
diff options
context:
space:
mode:
authorDean Sanner <dsanner@us.ibm.com>2017-05-25 12:11:34 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2017-05-31 14:18:39 -0400
commitddfce1bdb0777724f17eda1559db2a8270912eac (patch)
tree7225b55058e2966293bf1b67262b12a1f84721c2 /src/usr/fapi2/plat_attr_override_sync.C
parente2cd6a048a9fd39cf37f4c5657a3515a43e2b081 (diff)
downloadtalos-hostboot-ddfce1bdb0777724f17eda1559db2a8270912eac.tar.gz
talos-hostboot-ddfce1bdb0777724f17eda1559db2a8270912eac.zip
Handle extremely large ATTR in ATTR dump tool
- ATTR_WOF_TABLE_DATA is 128K, dump tool used the stack for local buffer space and this ATTR exceeded stack space. Changed to use realloc Change-Id: Icbdc7c397507ce4244cce1c04171a49e0f6bcb68 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/40989 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com> Reviewed-by: Prachi Gupta <pragupta@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/fapi2/plat_attr_override_sync.C')
-rw-r--r--src/usr/fapi2/plat_attr_override_sync.C6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/usr/fapi2/plat_attr_override_sync.C b/src/usr/fapi2/plat_attr_override_sync.C
index d16324f47..33965118c 100644
--- a/src/usr/fapi2/plat_attr_override_sync.C
+++ b/src/usr/fapi2/plat_attr_override_sync.C
@@ -675,6 +675,8 @@ void AttrOverrideSync::setAttrActions(const AttributeId i_attrId,
//******************************************************************************
void AttrOverrideSync::triggerAttrSync()
{
+ uint8_t * l_buf = NULL;
+
//Walk through all HB targets and see if there is a matching FAPI target
//If so then get the list of ATTR for FAPI target and add to sync list
for (TARGETING::TargetIterator target = TARGETING::targetService().begin();
@@ -735,7 +737,7 @@ void AttrOverrideSync::triggerAttrSync()
l_attrs[i].iv_dims[3];
//Get the data
- uint8_t l_buf[l_bytes];
+ l_buf = reinterpret_cast<uint8_t *>(realloc(l_buf, l_bytes));
ReturnCode l_rc =
rawAccessAttr(
static_cast<fapi2::AttributeId>(l_attrs[i].iv_attrId),
@@ -751,6 +753,8 @@ void AttrOverrideSync::triggerAttrSync()
}
}
+ free(l_buf);
+
//Now push the data to the debug tool
sendFapiAttrSyncs();
}
OpenPOWER on IntegriCloud