summaryrefslogtreecommitdiff
path: root/kernel/events
diff options
context:
space:
mode:
authorKnut Petersen <Knut_Petersen@t-online.de>2013-09-25 14:29:37 +0200
committerIngo Molnar <mingo@kernel.org>2013-10-04 10:06:07 +0200
commit723478c8a471403c53cf144999701f6e0c4bbd11 (patch)
treed89b59d4318eb5e37082f90880ac20b18f81a020 /kernel/events
parent354cc40e3b0981c38ba2ce2964954480e6c03c37 (diff)
perf: Enforce 1 as lower limit for perf_event_max_sample_rate
/proc/sys/kernel/perf_event_max_sample_rate will accept negative values as well as 0. Negative values are unreasonable, and 0 causes a divide by zero exception in perf_proc_update_handler. This patch enforces a lower limit of 1. Signed-off-by: Knut Petersen <Knut_Petersen@t-online.de> Signed-off-by: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/5242DB0C.4070005@t-online.de Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/events')
-rw-r--r--kernel/events/core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/events/core.c b/kernel/events/core.c
index d49a9d29334c..b25d65ce7106 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -193,7 +193,7 @@ int perf_proc_update_handler(struct ctl_table *table, int write,
void __user *buffer, size_t *lenp,
loff_t *ppos)
{
- int ret = proc_dointvec(table, write, buffer, lenp, ppos);
+ int ret = proc_dointvec_minmax(table, write, buffer, lenp, ppos);
if (ret || !write)
return ret;