diff options
Diffstat (limited to 'arch/i386/oprofile')
-rw-r--r-- | arch/i386/oprofile/nmi_int.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/arch/i386/oprofile/nmi_int.c b/arch/i386/oprofile/nmi_int.c index 0493e8b8ec49..1accce50c2c7 100644 --- a/arch/i386/oprofile/nmi_int.c +++ b/arch/i386/oprofile/nmi_int.c | |||
@@ -122,7 +122,7 @@ static void nmi_save_registers(void * dummy) | |||
122 | static void free_msrs(void) | 122 | static void free_msrs(void) |
123 | { | 123 | { |
124 | int i; | 124 | int i; |
125 | for (i = 0; i < NR_CPUS; ++i) { | 125 | for_each_cpu(i) { |
126 | kfree(cpu_msrs[i].counters); | 126 | kfree(cpu_msrs[i].counters); |
127 | cpu_msrs[i].counters = NULL; | 127 | cpu_msrs[i].counters = NULL; |
128 | kfree(cpu_msrs[i].controls); | 128 | kfree(cpu_msrs[i].controls); |
@@ -138,10 +138,7 @@ static int allocate_msrs(void) | |||
138 | size_t counters_size = sizeof(struct op_msr) * model->num_counters; | 138 | size_t counters_size = sizeof(struct op_msr) * model->num_counters; |
139 | 139 | ||
140 | int i; | 140 | int i; |
141 | for (i = 0; i < NR_CPUS; ++i) { | 141 | for_each_online_cpu(i) { |
142 | if (!cpu_online(i)) | ||
143 | continue; | ||
144 | |||
145 | cpu_msrs[i].counters = kmalloc(counters_size, GFP_KERNEL); | 142 | cpu_msrs[i].counters = kmalloc(counters_size, GFP_KERNEL); |
146 | if (!cpu_msrs[i].counters) { | 143 | if (!cpu_msrs[i].counters) { |
147 | success = 0; | 144 | success = 0; |