diff options
-rw-r--r-- | arch/x86/kernel/pci-calgary_64.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/arch/x86/kernel/pci-calgary_64.c b/arch/x86/kernel/pci-calgary_64.c index 218d783ed7a8..363a74ec7a76 100644 --- a/arch/x86/kernel/pci-calgary_64.c +++ b/arch/x86/kernel/pci-calgary_64.c | |||
@@ -1269,13 +1269,15 @@ static inline int __init determine_tce_table_size(u64 ram) | |||
1269 | static int __init build_detail_arrays(void) | 1269 | static int __init build_detail_arrays(void) |
1270 | { | 1270 | { |
1271 | unsigned long ptr; | 1271 | unsigned long ptr; |
1272 | int i, scal_detail_size, rio_detail_size; | 1272 | unsigned numnodes, i; |
1273 | int scal_detail_size, rio_detail_size; | ||
1273 | 1274 | ||
1274 | if (rio_table_hdr->num_scal_dev > MAX_NUMNODES){ | 1275 | numnodes = rio_table_hdr->num_scal_dev; |
1276 | if (numnodes > MAX_NUMNODES){ | ||
1275 | printk(KERN_WARNING | 1277 | printk(KERN_WARNING |
1276 | "Calgary: MAX_NUMNODES too low! Defined as %d, " | 1278 | "Calgary: MAX_NUMNODES too low! Defined as %d, " |
1277 | "but system has %d nodes.\n", | 1279 | "but system has %d nodes.\n", |
1278 | MAX_NUMNODES, rio_table_hdr->num_scal_dev); | 1280 | MAX_NUMNODES, numnodes); |
1279 | return -ENODEV; | 1281 | return -ENODEV; |
1280 | } | 1282 | } |
1281 | 1283 | ||
@@ -1296,8 +1298,7 @@ static int __init build_detail_arrays(void) | |||
1296 | } | 1298 | } |
1297 | 1299 | ||
1298 | ptr = ((unsigned long)rio_table_hdr) + 3; | 1300 | ptr = ((unsigned long)rio_table_hdr) + 3; |
1299 | for (i = 0; i < rio_table_hdr->num_scal_dev; | 1301 | for (i = 0; i < numnodes; i++, ptr += scal_detail_size) |
1300 | i++, ptr += scal_detail_size) | ||
1301 | scal_devs[i] = (struct scal_detail *)ptr; | 1302 | scal_devs[i] = (struct scal_detail *)ptr; |
1302 | 1303 | ||
1303 | for (i = 0; i < rio_table_hdr->num_rio_dev; | 1304 | for (i = 0; i < rio_table_hdr->num_rio_dev; |