Message ID | tip-37c528ee1af7f24eb31f4195b8b7d4f23e6c716d@git.kernel.org (mailing list archive) |
---|---|
State | Not Applicable, archived |
Headers | show |
diff --git a/arch/x86/kernel/tsc_msr.c b/arch/x86/kernel/tsc_msr.c index e0c2b30..e6e465e 100644 --- a/arch/x86/kernel/tsc_msr.c +++ b/arch/x86/kernel/tsc_msr.c @@ -70,7 +70,7 @@ static int match_cpu(u8 family, u8 model) */ unsigned long cpu_khz_from_msr(void) { - u32 lo, hi, ratio, freq_id, freq; + u32 lo, hi, freq_id, freq, ratio = 0; unsigned long res; int cpu_index; @@ -123,8 +123,8 @@ unsigned long cpu_khz_from_msr(void) } get_ratio: - rdmsr(MSR_PLATFORM_INFO, lo, hi); - ratio = (lo >> 8) & 0xff; + if (!rdmsr_safe(MSR_PLATFORM_INFO, &lo, &hi)) + ratio = (lo >> 8) & 0xff; done: /* TSC frequency = maximum resolved freq * maximum resolved bus ratio */