diff options
author | Robert Richter <robert.richter@amd.com> | 2011-08-16 17:39:53 -0400 |
---|---|---|
committer | Robert Richter <robert.richter@amd.com> | 2011-08-16 17:51:00 -0400 |
commit | 298557db42eb2d6efca81669dc369425b46c5be6 (patch) | |
tree | 84b659f9875b69c092c6ae0adb25362fc42c66da /arch/x86/oprofile | |
parent | 1d12d35284b74b7257b84ba0cef1e82a66d73aea (diff) |
oprofile, x86: Fix overflow and warning (commit 1d12d35)
Following fixes for:
1d12d35 oprofile, x86: Convert memory allocation to static array
Fix potential buffer overflow.
Fix the following warning:
arch/x86/oprofile/op_model_ppro.c: In function ‘ppro_check_ctrs’:
arch/x86/oprofile/op_model_ppro.c:143: warning: label ‘out’ defined but not used
Cc: Maarten Lankhorst <m.b.lankhorst@gmail.com>
Cc: Andi Kleen <andi@firstfloor.org>
Signed-off-by: Robert Richter <robert.richter@amd.com>
Diffstat (limited to 'arch/x86/oprofile')
-rw-r--r-- | arch/x86/oprofile/op_model_ppro.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/x86/oprofile/op_model_ppro.c b/arch/x86/oprofile/op_model_ppro.c index 608874b70cf4..d90528ea5412 100644 --- a/arch/x86/oprofile/op_model_ppro.c +++ b/arch/x86/oprofile/op_model_ppro.c | |||
@@ -140,7 +140,6 @@ static int ppro_check_ctrs(struct pt_regs * const regs, | |||
140 | wrmsrl(msrs->counters[i].addr, -reset_value[i]); | 140 | wrmsrl(msrs->counters[i].addr, -reset_value[i]); |
141 | } | 141 | } |
142 | 142 | ||
143 | out: | ||
144 | /* Only P6 based Pentium M need to re-unmask the apic vector but it | 143 | /* Only P6 based Pentium M need to re-unmask the apic vector but it |
145 | * doesn't hurt other P6 variant */ | 144 | * doesn't hurt other P6 variant */ |
146 | apic_write(APIC_LVTPC, apic_read(APIC_LVTPC) & ~APIC_LVT_MASKED); | 145 | apic_write(APIC_LVTPC, apic_read(APIC_LVTPC) & ~APIC_LVT_MASKED); |
@@ -220,7 +219,7 @@ static void arch_perfmon_setup_counters(void) | |||
220 | eax.split.bit_width = 40; | 219 | eax.split.bit_width = 40; |
221 | } | 220 | } |
222 | 221 | ||
223 | num_counters = eax.split.num_counters; | 222 | num_counters = min((int)eax.split.num_counters, OP_MAX_COUNTER); |
224 | 223 | ||
225 | op_arch_perfmon_spec.num_counters = num_counters; | 224 | op_arch_perfmon_spec.num_counters = num_counters; |
226 | op_arch_perfmon_spec.num_controls = num_counters; | 225 | op_arch_perfmon_spec.num_controls = num_counters; |