aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/sn
diff options
context:
space:
mode:
authorMark Goodwin <markgw@sgi.com>2005-04-25 16:05:08 -0400
committerTony Luck <tony.luck@intel.com>2005-04-25 16:05:08 -0400
commitf1e2a1c8a1fe16db5f4a7c0c1551d6e1b97dcbb2 (patch)
treeb85b5659b94cdb1f656f11f4761fe0836c011076 /arch/ia64/sn
parent4a5c13c7eb0d55bfd2cf3100c55f1e3d8df37576 (diff)
[IA64-SGI] Altix SN topology fix potential infinite loop
Fix infinite loop if sn_hwperf_location_to_bpos() fails. Signed-off-by: Mark Goodwin <markgw@sgi.com> Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch/ia64/sn')
-rw-r--r--arch/ia64/sn/kernel/sn2/sn_hwperf.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/arch/ia64/sn/kernel/sn2/sn_hwperf.c b/arch/ia64/sn/kernel/sn2/sn_hwperf.c
index 3bff99130d5e..e731fcb95f90 100644
--- a/arch/ia64/sn/kernel/sn2/sn_hwperf.c
+++ b/arch/ia64/sn/kernel/sn2/sn_hwperf.c
@@ -300,14 +300,15 @@ static int sn_topology_show(struct seq_file *s, void *d)
300 * PCI busses attached to this node, if any 300 * PCI busses attached to this node, if any
301 */ 301 */
302 do { 302 do {
303 if (!(pci_topo_buf = vmalloc(pci_topo_buf_len))) { 303 if (sn_hwperf_location_to_bpos(obj->location,
304 printk("sn_topology_show: kmalloc failed\n"); 304 &rack, &bay, &slot, &slab)) {
305 break; 305 break;
306 } 306 }
307 307
308 if (sn_hwperf_location_to_bpos(obj->location, 308 if (!(pci_topo_buf = vmalloc(pci_topo_buf_len))) {
309 &rack, &bay, &slot, &slab) != 0) 309 printk("sn_topology_show: vmalloc failed\n");
310 continue; 310 break;
311 }
311 312
312 e = ia64_sn_ioif_get_pci_topology(rack, bay, slot, slab, 313 e = ia64_sn_ioif_get_pci_topology(rack, bay, slot, slab,
313 pci_topo_buf, pci_topo_buf_len); 314 pci_topo_buf, pci_topo_buf_len);
@@ -325,6 +326,7 @@ static int sn_topology_show(struct seq_file *s, void *d)
325 break; 326 break;
326 327
327 case SN_HWPERF_OP_OK: 328 case SN_HWPERF_OP_OK:
329 default:
328 /* export pci bus info */ 330 /* export pci bus info */
329 print_pci_topology(s, obj, &pci_bus_ordinal, 331 print_pci_topology(s, obj, &pci_bus_ordinal,
330 pci_topo_buf, pci_topo_buf_len); 332 pci_topo_buf, pci_topo_buf_len);