diff options
author | Oliver O'Halloran <oohall@gmail.com> | 2016-09-05 12:07:47 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2016-09-14 16:34:31 +1000 |
commit | 6b172793a752cf9032371f59d5f3c4b2a3556006 (patch) | |
tree | ca7c7c656005e4986a22ecd789350a2872f27236 /core/vpd.c | |
parent | 091381febee4523cf8da0d9aa70bdba72cb32cd7 (diff) | |
download | blackbird-skiboot-6b172793a752cf9032371f59d5f3c4b2a3556006.tar.gz blackbird-skiboot-6b172793a752cf9032371f59d5f3c4b2a3556006.zip |
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 <gwshan@linux.vnet.ibm.com>
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
[stewart@linux.vnet.ibm.com: fix missing verb]
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'core/vpd.c')
-rw-r--r-- | core/vpd.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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); |