summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzx143588 <none@none>2007-04-09 14:01:48 -0700
committerzx143588 <none@none>2007-04-09 14:01:48 -0700
commit94ed70ba882f07af3d2ca6103e041951a9ab887c (patch)
treeacb803d1e84b2c3f7b10b1aa7a0bc393f64eda3e
parent77d1565c06c50a8eb957f25b30dd76fab299ff2e (diff)
downloadillumos-joyent-94ed70ba882f07af3d2ca6103e041951a9ab887c.tar.gz
6518672 pci enumerator shouldn't assume the platform name in "SUNW,xxx" format
-rw-r--r--usr/src/lib/fm/topo/modules/common/pcibus/pcibus_labels.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/usr/src/lib/fm/topo/modules/common/pcibus/pcibus_labels.c b/usr/src/lib/fm/topo/modules/common/pcibus/pcibus_labels.c
index 9dd528c7a7..c91da59582 100644
--- a/usr/src/lib/fm/topo/modules/common/pcibus/pcibus_labels.c
+++ b/usr/src/lib/fm/topo/modules/common/pcibus/pcibus_labels.c
@@ -46,7 +46,8 @@ pci_physslot_name_lookup(char *platform, did_t *dp)
const char *rlabel = NULL;
int n, p, i;
- if ((n = did_physslot(dp)) < 0 || Physlot_Names == NULL)
+ if ((n = did_physslot(dp)) < 0 || Physlot_Names == NULL ||
+ platform == NULL)
return (NULL);
for (p = 0; p < Physlot_Names->psn_nplats; p++) {
@@ -149,7 +150,10 @@ pci_slotname_lookup(topo_mod_t *mod, tnode_t *node, did_t *dp)
* Trim SUNW, from the platform name
*/
pp = strchr(plat, ',');
- ++pp;
+ if (pp == NULL)
+ pp = plat;
+ else
+ ++pp;
did_BDF(dp, NULL, &d, NULL);
if ((l = pci_physslot_name_lookup(pp, dp)) == NULL)