[PATCH] perf: Prevent divide by zero exception in kernel/events/core.c

From: Knut Petersen
Date: Wed Sep 25 2013 - 08:08:01 EST


This is a multi-part message in MIME format.Any value written to /proc/sys/kernel/perf_event_max_sample_rate
is accepted and used as a divisor in perf_proc_update_handler().

Obviously that is wrong. 0 will cause a divide by 0 exception,
and negative values are unreasonable.

The attached patch enforces a lower limit of 1.

cu,
Knut