summaryrefslogtreecommitdiffstats
path: root/hw/ipmi
diff options
context:
space:
mode:
authorAlistair Popple <alistair@popple.id.au>2015-04-14 13:36:03 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2015-04-18 05:30:03 +1000
commit407a264f6fecd2d0d02056765ab48c2be61d1a55 (patch)
tree189b76b41ae938ffca71bff1ef2587bd538582e1 /hw/ipmi
parentcf99c29e04f60f5430c9a7d32cb283cd10aaa38c (diff)
downloadblackbird-skiboot-407a264f6fecd2d0d02056765ab48c2be61d1a55.tar.gz
blackbird-skiboot-407a264f6fecd2d0d02056765ab48c2be61d1a55.zip
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/ipmi')
-rw-r--r--hw/ipmi/ipmi-fru.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/hw/ipmi/ipmi-fru.c b/hw/ipmi/ipmi-fru.c
index be3ca907..ddcb3d6f 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) */
OpenPOWER on IntegriCloud