summaryrefslogtreecommitdiffstats
path: root/src/usr/fapi2
diff options
context:
space:
mode:
authorElizabeth Liner <eliner@us.ibm.com>2017-08-22 22:23:18 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2017-08-25 10:30:51 -0400
commit0b0340c113387ff84619ca40c701cc6238535c9c (patch)
treea45f02f89c13ca065d97327a6d4180665c4c4859 /src/usr/fapi2
parentc68be97f69a6ae2eabf075200583a1e47afdc597 (diff)
downloadblackbird-hostboot-0b0340c113387ff84619ca40c701cc6238535c9c.tar.gz
blackbird-hostboot-0b0340c113387ff84619ca40c701cc6238535c9c.zip
Fixing error handling in the PNOR MEMD functionality
Change-Id: I8232bf7a8349425c99d8318cc4125b031035930f RTC:175158 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/45018 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Martin Gloff <mgloff@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/fapi2')
-rw-r--r--src/usr/fapi2/plat_vpd_access.C23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/usr/fapi2/plat_vpd_access.C b/src/usr/fapi2/plat_vpd_access.C
index ba9a720ca..dd360e8d1 100644
--- a/src/usr/fapi2/plat_vpd_access.C
+++ b/src/usr/fapi2/plat_vpd_access.C
@@ -52,6 +52,8 @@ fapi2::ReturnCode platGetVPD(
fapi2::ReturnCode l_rc = fapi2::FAPI2_RC_SUCCESS;
errlHndl_t l_errl = nullptr;
keywordInfo_t l_keywordInfo;
+ uint8_t* l_dvpd_vm = nullptr;
+ uint32_t* l_full_dvpdVM = nullptr;
// Assume that all memory keywords (MR,MT,J0..JZ,X0...XZ) are all the
// same size of 255. This avoids going through the decode and asking
@@ -218,8 +220,6 @@ fapi2::ReturnCode platGetVPD(
l_errl = PNOR::getSectionInfo(PNOR::MEMD,l_memd_info);
bool l_memd_found = false;
MemdHeader_t l_header;
- uint8_t* l_dvpd_vm = nullptr;
- uint32_t* l_full_dvpdVM = nullptr;
if( l_errl )
{
@@ -279,6 +279,7 @@ fapi2::ReturnCode platGetVPD(
l_buffSize,
DEVICE_MEMD_VPD_ADDRESS(MEMD_VPD::MEMD,
l_mapKeyword) + l_memd_offset_bytes );
+ break;
}else
{
FAPI_INF("platGetVPD: Matching MEMD data was not found in "
@@ -289,6 +290,13 @@ fapi2::ReturnCode platGetVPD(
}while(0);
}
+ if(l_errl)
+ {
+ FAPI_ERR("find_memd_in_pnor: ERROR getting the PNOR MEMD information");
+ l_rc.setPlatDataPtr(reinterpret_cast<void *>(l_errl));
+ break;
+ }
+
if( !(l_memd_found) )
{
FAPI_INF("platGetVPD: MEMD data was not found in the PNOR "
@@ -303,19 +311,12 @@ fapi2::ReturnCode platGetVPD(
if (l_errl)
{
delete l_pMapping;
- free(l_dvpd_vm);
- l_dvpd_vm = nullptr;
- l_full_dvpdVM = nullptr;
l_pMapping = nullptr;
FAPI_ERR("platGetVPD: ERROR reading mapping keyword");
l_rc.setPlatDataPtr(reinterpret_cast<void *> (l_errl));
break; //return with error
}
}
- free(l_dvpd_vm);
- l_dvpd_vm = nullptr;
- l_full_dvpdVM = nullptr;
-
// Find vpd keyword name based on VPDInfo
FAPI_EXEC_HWP(l_rc,
@@ -440,6 +441,10 @@ fapi2::ReturnCode platGetVPD(
}
while (0);
+ free(l_dvpd_vm);
+ l_dvpd_vm = nullptr;
+ l_full_dvpdVM = nullptr;
+
FAPI_DBG("platGetVPD: exit");
return l_rc;
OpenPOWER on IntegriCloud