From 6b172793a752cf9032371f59d5f3c4b2a3556006 Mon Sep 17 00:00:00 2001 From: Oliver O'Halloran Date: Mon, 5 Sep 2016 12:07:47 +1000 Subject: core/vpd: remove assert() when checking for VPD The VPD LID is used on FSP machines to discover hotpluggable PCI slots. Currently if we fail to load the LID skiboot will fail an assert() preventing the system from booting. This is excessive since this is an otherwise recoverable failure. This patch converts the assert() to an if-NULL-return check so we can continue to boot. Cc: Gavin Shan Signed-off-by: Oliver O'Halloran [stewart@linux.vnet.ibm.com: fix missing verb] Signed-off-by: Stewart Smith --- core/vpd.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/core/vpd.c b/core/vpd.c index 85a9937..b5e1493 100644 --- a/core/vpd.c +++ b/core/vpd.c @@ -61,6 +61,9 @@ const void *vpd_find_record(const void *vpd, size_t vpd_size, uint8_t namesz = 0; const char *rec_name; + if (!vpd) + return NULL; + while (CHECK_SPACE(p, 4, end)) { /* Get header byte */ if (*(p++) != 0x84) { @@ -186,8 +189,10 @@ void vpd_iohub_load(struct dt_node *hub_node) lxrn = p[0]; lx = (const char *)&p[1]; - assert(vpd); - assert(vpd_lid_no); + if (!vpd || !vpd_lid_no) { + prlog(PR_WARNING, "VPD: WARNING: Unable to load VPD lid"); + return; + } r = fsp_wait_lid_loaded(vpd_lid_no); -- cgit v1.1