]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - arch/x86/kernel/apic/nmi.c
Merge branch 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[net-next-2.6.git] / arch / x86 / kernel / apic / nmi.c
index 02056310f2f55a2b7f252716f2cba425c5db21f5..a691302dc3ffa4e5e4771df1fedf17919d7133c6 100644 (file)
@@ -138,7 +138,7 @@ int __init check_nmi_watchdog(void)
        if (!prev_nmi_count)
                goto error;
 
-       alloc_cpumask_var(&backtrace_mask, GFP_KERNEL);
+       alloc_cpumask_var(&backtrace_mask, GFP_KERNEL|__GFP_ZERO);
        printk(KERN_INFO "Testing NMI watchdog ... ");
 
 #ifdef CONFIG_SMP
@@ -414,7 +414,8 @@ nmi_watchdog_tick(struct pt_regs *regs, unsigned reason)
                touched = 1;
        }
 
-       if (cpumask_test_cpu(cpu, backtrace_mask)) {
+       /* We can be called before check_nmi_watchdog, hence NULL check. */
+       if (backtrace_mask != NULL && cpumask_test_cpu(cpu, backtrace_mask)) {
                static DEFINE_SPINLOCK(lock);   /* Serialise the printks */
 
                spin_lock(&lock);