[PATCH ia64 2.6.11] Altix SN topology fix potential infinite loop

From: Mark Goodwin <markgw_at_sgi.com>
Date: 2005-03-09 12:07:33
Fix infinite loop if sn_hwperf_location_to_bpos() fails.

Signed-off-by: Mark Goodwin <markgw@sgi.com>

diff -auNr linux.orig/arch/ia64/sn/kernel/sn2/sn_hwperf.c linux/arch/ia64/sn/kernel/sn2/sn_hwperf.c
--- linux.orig/arch/ia64/sn/kernel/sn2/sn_hwperf.c	2005-03-08 17:50:50.000000000 +1100
+++ linux/arch/ia64/sn/kernel/sn2/sn_hwperf.c	2005-03-09 11:59:54.000000000 +1100
@@ -300,14 +300,15 @@
 		 * PCI busses attached to this node, if any
 		 */
 		do {
-			if (!(pci_topo_buf = vmalloc(pci_topo_buf_len))) {
-				printk("sn_topology_show: kmalloc failed\n");
+			if (sn_hwperf_location_to_bpos(obj->location,
+				&rack, &bay, &slot, &slab) {
 				break;
 			}
 
-			if (sn_hwperf_location_to_bpos(obj->location,
-				&rack, &bay, &slot, &slab) != 0)
-				continue;
+			if (!(pci_topo_buf = vmalloc(pci_topo_buf_len))) {
+				printk("sn_topology_show: vmalloc failed\n");
+				break;
+			}
 
 			e = ia64_sn_ioif_get_pci_topology(rack, bay, slot, slab,
 			    	pci_topo_buf, pci_topo_buf_len);
@@ -325,6 +326,7 @@
 				break;
 
 			case SN_HWPERF_OP_OK:
+			default:
 				/* export pci bus info */
 				print_pci_topology(s, obj, &pci_bus_ordinal,
 					pci_topo_buf, pci_topo_buf_len);
-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Tue Mar 8 20:19:51 2005

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:36 EST