Index: linux-2.6/arch/x86/kernel/cpu/perf_event.c =================================================================== --- linux-2.6.orig/arch/x86/kernel/cpu/perf_event.c +++ linux-2.6/arch/x86/kernel/cpu/perf_event.c @@ -383,14 +383,13 @@ static bool check_hw_exists(void) { - u64 val, val_new; - + u64 val, val_new = 0; + int ret = 0; val = 0xabcdUL; - (void) checking_wrmsrl(x86_pmu.perfctr, val); - rdmsrl_safe(x86_pmu.perfctr, &val_new); - if (val != val_new) + ret |= checking_wrmsrl(x86_pmu.perfctr, val); + ret |= rdmsrl_safe(x86_pmu.perfctr, &val_new); + if (ret || val != val_new) return false; - return true; }