[PATCH 1/8] NR_CPUS: Replace NR_CPUS in arch/x86/kernel/cpu/mcheck/mce_64.c

From: Mike Travis
Date: Fri Jul 18 2008 - 21:11:39 EST


* nr_cpu_ids should be used to allocate arrays based on the number of
cpu's present.

Applies to both tip/master and linux-next.

Signed-off-by: Mike Travis <travis@xxxxxxx>
Cc: Cc: Eric W. Biederman <ebiederm@xxxxxxxxxxxx>
---
arch/x86/kernel/cpu/mcheck/mce_64.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-2.6.tip.orig/arch/x86/kernel/cpu/mcheck/mce_64.c
+++ linux-2.6.tip/arch/x86/kernel/cpu/mcheck/mce_64.c
@@ -580,7 +580,7 @@ static ssize_t mce_read(struct file *fil
char __user *buf = ubuf;
int i, err;

- cpu_tsc = kmalloc(NR_CPUS * sizeof(long), GFP_KERNEL);
+ cpu_tsc = kmalloc(nr_cpu_ids * sizeof(long), GFP_KERNEL);
if (!cpu_tsc)
return -ENOMEM;


--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/