summaryrefslogtreecommitdiffstats
path: root/src/usr/ipmi
diff options
context:
space:
mode:
authorChristian Geddes <crgeddes@us.ibm.com>2017-09-08 10:22:52 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2017-09-25 11:54:57 -0400
commit1b3b999258db544d6af1dbfb7ee3437efd17581b (patch)
tree1cb96dd1838af832ef630398c93cfedeaafda3ef /src/usr/ipmi
parentac058e9b3c6d1d5d57089d42cbb75b76f36d24a2 (diff)
downloadtalos-hostboot-1b3b999258db544d6af1dbfb7ee3437efd17581b.tar.gz
talos-hostboot-1b3b999258db544d6af1dbfb7ee3437efd17581b.zip
Set variables to nullptr after they are deleted
While updating some LPC logic a developer noticed a bug where an errlog handle wasnt getting set to nullptr after it was deleted this caused a confusing bug that took awhile to track. I noticed that this bug was all over our code so this commit fixes a lot of cases where variables get deleted but not set to nullptr Change-Id: I103b5c71b93686c3c89b04d1d565a24d4de74e6f Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/45890 Tested-by: Jenkins Server <pfd-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> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Reviewed-by: Matt Derksen <mderkse1@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/ipmi')
-rw-r--r--src/usr/ipmi/ipmifruinv.C2
-rw-r--r--src/usr/ipmi/ipmisensor.C1
2 files changed, 3 insertions, 0 deletions
diff --git a/src/usr/ipmi/ipmifruinv.C b/src/usr/ipmi/ipmifruinv.C
index 8903535a8..bbdb0f95e 100644
--- a/src/usr/ipmi/ipmifruinv.C
+++ b/src/usr/ipmi/ipmifruinv.C
@@ -501,6 +501,7 @@ void IpmiFruInv::setMfgData(std::vector<uint8_t> &io_data,
io_data.push_back(0);
io_data.push_back(0);
delete l_errl;
+ l_errl = nullptr;
}
else
{
@@ -1668,6 +1669,7 @@ void IPMIFRUINV::setData(bool i_updateData)
l_fruId, l_curFru.size());
l_fru->sendFruData(l_fruId);
delete l_fru;
+ l_fru = nullptr;
}
}
diff --git a/src/usr/ipmi/ipmisensor.C b/src/usr/ipmi/ipmisensor.C
index 5be1dc1af..c5d8ef345 100644
--- a/src/usr/ipmi/ipmisensor.C
+++ b/src/usr/ipmi/ipmisensor.C
@@ -1394,6 +1394,7 @@ namespace SENSOR
if (l_errl || (L_obus_cfgID_bit == 0))
{
delete l_errl;
+ l_errl = nullptr;
// default to full list of GPU sensors
L_obus_cfgID_bit = NVCFG_ALL_SENSORS_RETURNED;
}
OpenPOWER on IntegriCloud