aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86_64/kernel/nmi.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/arch/x86_64/kernel/nmi.c b/arch/x86_64/kernel/nmi.c
index 61de0b34a01e..ec13eb97e8e6 100644
--- a/arch/x86_64/kernel/nmi.c
+++ b/arch/x86_64/kernel/nmi.c
@@ -114,7 +114,7 @@ static __init int cpu_has_lapic(void)
114 114
115static int __init check_nmi_watchdog (void) 115static int __init check_nmi_watchdog (void)
116{ 116{
117 int counts[NR_CPUS]; 117 int *counts;
118 int cpu; 118 int cpu;
119 119
120 if (nmi_watchdog == NMI_NONE) 120 if (nmi_watchdog == NMI_NONE)
@@ -125,6 +125,12 @@ static int __init check_nmi_watchdog (void)
125 return -1; 125 return -1;
126 } 126 }
127 127
128 counts = kmalloc(NR_CPUS * sizeof(int),GFP_KERNEL);
129 if (!counts) {
130 nmi_watchdog = NMI_NONE;
131 return 0;
132 }
133
128 printk(KERN_INFO "Testing NMI watchdog ... "); 134 printk(KERN_INFO "Testing NMI watchdog ... ");
129 135
130 for (cpu = 0; cpu < NR_CPUS; cpu++) 136 for (cpu = 0; cpu < NR_CPUS; cpu++)
@@ -139,6 +145,7 @@ static int __init check_nmi_watchdog (void)
139 cpu_pda[cpu].__nmi_count); 145 cpu_pda[cpu].__nmi_count);
140 nmi_active = 0; 146 nmi_active = 0;
141 lapic_nmi_owner &= ~LAPIC_NMI_WATCHDOG; 147 lapic_nmi_owner &= ~LAPIC_NMI_WATCHDOG;
148 kfree(counts);
142 return -1; 149 return -1;
143 } 150 }
144 } 151 }
@@ -149,6 +156,7 @@ static int __init check_nmi_watchdog (void)
149 if (nmi_watchdog == NMI_LOCAL_APIC) 156 if (nmi_watchdog == NMI_LOCAL_APIC)
150 nmi_hz = 1; 157 nmi_hz = 1;
151 158
159 kfree(counts);
152 return 0; 160 return 0;
153} 161}
154/* Have this called later during boot so counters are updating */ 162/* Have this called later during boot so counters are updating */