summaryrefslogtreecommitdiffstats
path: root/hw
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2018-03-25 10:48:18 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2018-03-27 00:44:17 -0500
commit103f67fe83f1f42fe200a60faa053add0282cc8b (patch)
treeadeff1dd161d4896ebd2f4b72533f9d5af36d99d /hw
parenta1c3dcca81cec2755c64b97305a045382b74d2aa (diff)
downloadtalos-skiboot-103f67fe83f1f42fe200a60faa053add0282cc8b.tar.gz
talos-skiboot-103f67fe83f1f42fe200a60faa053add0282cc8b.zip
hw/imc: don't access homer memory if it was not initialised
This can happen under mambo, at least. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Reviewed-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/imc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/hw/imc.c b/hw/imc.c
index 53e84c26..a56f3367 100644
--- a/hw/imc.c
+++ b/hw/imc.c
@@ -154,6 +154,9 @@ static struct imc_chip_cb *get_imc_cb(uint32_t chip_id)
struct proc_chip *chip = get_chip(chip_id);
struct imc_chip_cb *cb;
+ if (!chip->homer_base)
+ return NULL; /* The No Homers Club */
+
cb = (struct imc_chip_cb *)(chip->homer_base + P9_CB_STRUCT_OFFSET);
if (!is_nest_mem_initialized(cb))
return NULL;
OpenPOWER on IntegriCloud