NR_CPUS: Replace NR_CPUS in arch/x86/kernel/cpu/mcheck/mce_64.c
authorMike Travis <travis@sgi.com>
Sat, 19 Jul 2008 01:11:27 +0000 (18:11 -0700)
committerIngo Molnar <mingo@elte.hu>
Sun, 20 Jul 2008 08:21:08 +0000 (10:21 +0200)
  * nr_cpu_ids should be used to allocate arrays based on the number of
    cpu's present.

Signed-off-by: Mike Travis <travis@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/kernel/cpu/mcheck/mce_64.c

index c4a7ec3..2fe06ab 100644 (file)
@@ -580,7 +580,7 @@ static ssize_t mce_read(struct file *filp, char __user *ubuf, size_t usize,
        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;