From 35f003a01174b253239bfd33fcc12dcf88378ce9 Mon Sep 17 00:00:00 2001 From: Cyril Bur Date: Mon, 19 Mar 2018 15:54:17 +1100 Subject: hw/imc: Don't dereference possible NULL Fixes: CID 263056 and 263052 Signed-off-by: Cyril Bur Signed-off-by: Stewart Smith --- hw/imc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'hw/imc.c') diff --git a/hw/imc.c b/hw/imc.c index 5bc59b5..53e84c2 100644 --- a/hw/imc.c +++ b/hw/imc.c @@ -634,7 +634,6 @@ static int64_t opal_imc_counters_init(uint32_t type, uint64_t addr, uint64_t cpu { struct cpu_thread *c = find_cpu_by_pir(cpu_pir); int port_id, phys_core_id; - struct proc_chip *chip = get_chip(c->chip_id); int ret; uint32_t scoms; @@ -681,6 +680,8 @@ static int64_t opal_imc_counters_init(uint32_t type, uint64_t addr, uint64_t cpu if (has_deep_states) { if ((wakeup_engine_state == WAKEUP_ENGINE_PRESENT)) { + struct proc_chip *chip = get_chip(c->chip_id); + prlog(PR_INFO, "Configuring stopapi for IMC\n"); scoms = XSCOM_ADDR_P9_EP(phys_core_id,pdbar_scom_index[port_id]); ret = p9_stop_save_scom(( void *)chip->homer_base,scoms, -- cgit v1.1