diff options
author | Madhavan Srinivasan <maddy@linux.vnet.ibm.com> | 2017-09-11 13:43:57 +0530 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2017-09-12 22:52:08 -0500 |
commit | 8782c0da7243fb6c608e6a00fd90957423832481 (patch) | |
tree | 424efbfd5f2e04093eeb159610b62f27909b0a46 /hw/imc.c | |
parent | 6bfa7b56b738de273ddb17434f5d57d555592da9 (diff) | |
download | skiboot-8782c0da7243fb6c608e6a00fd90957423832481.zip skiboot-8782c0da7243fb6c608e6a00fd90957423832481.tar.gz skiboot-8782c0da7243fb6c608e6a00fd90957423832481.tar.bz2 |
skiboot/hw/imc: Add NULL pointer check
Minor cleanup to avoid null pointer access.
Signed-off-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw/imc.c')
-rw-r--r-- | hw/imc.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -599,6 +599,8 @@ static int64_t opal_imc_counters_start(uint32_t type, uint64_t cpu_pir) case OPAL_IMC_COUNTERS_NEST: /* Fetch the IMC control block structure */ cb = get_imc_cb(c->chip_id); + if (!cb) + return OPAL_HARDWARE; /* Set the run command */ op = NEST_IMC_ENABLE; @@ -651,6 +653,8 @@ static int64_t opal_imc_counters_stop(uint32_t type, uint64_t cpu_pir) case OPAL_IMC_COUNTERS_NEST: /* Fetch the IMC control block structure */ cb = get_imc_cb(c->chip_id); + if (!cb) + return OPAL_HARDWARE; /* Set the run command */ op = NEST_IMC_DISABLE; |