Commit f1e2a1c8 authored by Mark Goodwin's avatar Mark Goodwin Committed by Tony Luck

[IA64-SGI] Altix SN topology fix potential infinite loop

Fix infinite loop if sn_hwperf_location_to_bpos() fails.
Signed-off-by: default avatarMark Goodwin <markgw@sgi.com>
Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
parent 4a5c13c7
...@@ -300,14 +300,15 @@ static int sn_topology_show(struct seq_file *s, void *d) ...@@ -300,14 +300,15 @@ static int sn_topology_show(struct seq_file *s, void *d)
* PCI busses attached to this node, if any * PCI busses attached to this node, if any
*/ */
do { do {
if (!(pci_topo_buf = vmalloc(pci_topo_buf_len))) { if (sn_hwperf_location_to_bpos(obj->location,
printk("sn_topology_show: kmalloc failed\n"); &rack, &bay, &slot, &slab)) {
break; break;
} }
if (sn_hwperf_location_to_bpos(obj->location, if (!(pci_topo_buf = vmalloc(pci_topo_buf_len))) {
&rack, &bay, &slot, &slab) != 0) printk("sn_topology_show: vmalloc failed\n");
continue; break;
}
e = ia64_sn_ioif_get_pci_topology(rack, bay, slot, slab, e = ia64_sn_ioif_get_pci_topology(rack, bay, slot, slab,
pci_topo_buf, pci_topo_buf_len); pci_topo_buf, pci_topo_buf_len);
...@@ -325,6 +326,7 @@ static int sn_topology_show(struct seq_file *s, void *d) ...@@ -325,6 +326,7 @@ static int sn_topology_show(struct seq_file *s, void *d)
break; break;
case SN_HWPERF_OP_OK: case SN_HWPERF_OP_OK:
default:
/* export pci bus info */ /* export pci bus info */
print_pci_topology(s, obj, &pci_bus_ordinal, print_pci_topology(s, obj, &pci_bus_ordinal,
pci_topo_buf, pci_topo_buf_len); pci_topo_buf, pci_topo_buf_len);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment