diff options
author | Alistair Popple <alistair@popple.id.au> | 2015-04-14 13:36:03 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2015-04-18 05:30:03 +1000 |
commit | 407a264f6fecd2d0d02056765ab48c2be61d1a55 (patch) | |
tree | 189b76b41ae938ffca71bff1ef2587bd538582e1 /hw | |
parent | cf99c29e04f60f5430c9a7d32cb283cd10aaa38c (diff) | |
download | skiboot-407a264f6fecd2d0d02056765ab48c2be61d1a55.zip skiboot-407a264f6fecd2d0d02056765ab48c2be61d1a55.tar.gz skiboot-407a264f6fecd2d0d02056765ab48c2be61d1a55.tar.bz2 |
ipmi: Check for ipmi backend presence before use
Not all ipmi related functions check for a valid backend before
attempting to use it. Under normal circumstances this should not
happen as the platform should always register an ipmi backend. However
a system should be able to boot without a functional ipmi backend,
which is sometimes the case during system bringup.
This patch adds presence checks for an ipmi backend before attempting
to use it, thus allowing a system with a non-functional backend to
boot without ipmi.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Reviewed-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/ipmi/ipmi-fru.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/hw/ipmi/ipmi-fru.c b/hw/ipmi/ipmi-fru.c index be3ca90..ddcb3d6 100644 --- a/hw/ipmi/ipmi-fru.c +++ b/hw/ipmi/ipmi-fru.c @@ -213,6 +213,8 @@ static int fru_write(void) */ msg = ipmi_mkmsg(IPMI_DEFAULT_INTERFACE, IPMI_WRITE_FRU, fru_write_complete, NULL, NULL, FRU_DATA_SIZE + 5, 2); + if (!msg) + return OPAL_RESOURCE; msg->data[0] = fru_dev_id; /* FRU Device ID */ msg->data[1] = 0x0; /* Offset LSB (we always write a new common header) */ |