Skip to content

Commit

Permalink
skiboot/hw/imc: Add NULL pointer check
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Madhavan Srinivasan authored and stewartsmith committed Sep 13, 2017
1 parent 6bfa7b5 commit 8782c0d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions hw/imc.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 8782c0d

Please sign in to comment.