Commit 115ef3b7 authored by Thomas Gleixner's avatar Thomas Gleixner

watchdog/hardlockup/perf: Cure UP damage

for_each_cpu() unintuitively reports CPU0 as set independend of the actual
cpumask content on UP kernels. That leads to a NULL pointer dereference
when the cleanup function is invoked and there is no event to clean up.
Reported-by: default avatarFengguang Wu <fengguang.wu@intel.com>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent ab5fe3ff
......@@ -220,8 +220,13 @@ void hardlockup_detector_perf_cleanup(void)
for_each_cpu(cpu, &dead_events_mask) {
struct perf_event *event = per_cpu(watchdog_ev, cpu);
per_cpu(watchdog_ev, cpu) = NULL;
/*
* Required because for_each_cpu() reports unconditionally
* CPU0 as set on UP kernels. Sigh.
*/
if (event)
perf_event_release_kernel(event);
per_cpu(watchdog_ev, cpu) = NULL;
}
cpumask_clear(&dead_events_mask);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment