diff options
| author | Christian Geddes <crgeddes@us.ibm.com> | 2017-09-08 10:22:52 -0500 |
|---|---|---|
| committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2017-09-25 11:54:57 -0400 |
| commit | 1b3b999258db544d6af1dbfb7ee3437efd17581b (patch) | |
| tree | 1cb96dd1838af832ef630398c93cfedeaafda3ef /src/usr/errl | |
| parent | ac058e9b3c6d1d5d57089d42cbb75b76f36d24a2 (diff) | |
| download | talos-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/errl')
| -rw-r--r-- | src/usr/errl/errlmanager_common.C | 2 | ||||
| -rw-r--r-- | src/usr/errl/errludlogregister.C | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/usr/errl/errlmanager_common.C b/src/usr/errl/errlmanager_common.C index e69036195..8bd058fac 100644 --- a/src/usr/errl/errlmanager_common.C +++ b/src/usr/errl/errlmanager_common.C @@ -177,6 +177,7 @@ void ErrlManager::setupPnorInfo() sendErrLogToBmc(err, false /* do not resend SELs */); delete err; + err = nullptr; } else { @@ -724,6 +725,7 @@ void ErrlManager::sendErrLogToBmc(errlHndl_t &io_err, bool i_sendSels) l_sensorType[j] = 0; delete l_errl; + l_errl = nullptr; } // this call will modify the sensor if any procedure diff --git a/src/usr/errl/errludlogregister.C b/src/usr/errl/errludlogregister.C index 77e385dbb..43742605b 100644 --- a/src/usr/errl/errludlogregister.C +++ b/src/usr/errl/errludlogregister.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2012,2014 */ +/* Contributors Listed Below - COPYRIGHT 2012,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -184,12 +184,13 @@ void ErrlUserDetailsLogRegister::readRegister( ®_data, reg_size, (DeviceFW::AccessType) i_accessType, i_args); - if (unlikely(errl != NULL)) + if (unlikely(errl != nullptr)) { // error! TRACFCOMP(g_trac_errl, "LogRegister: deviceOpValist type %d" " threw errl! deleting errl.", i_accessType); delete errl; // eat the error - just delete it + errl = nullptr; // nothing gets written out } |

