summaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace_events_hist.c
diff options
context:
space:
mode:
authorZheng Yejian <zhengyejian1@huawei.com>2022-12-07 04:46:35 +0100
committerSteven Rostedt (Google) <rostedt@goodmis.org>2022-12-10 19:36:04 +0100
commit2cc6a528882d0e0ccbc1bca5f95b8c963cedac54 (patch)
treefc33e72f9f2e28cbfe15b9508fa5b3e41b67a269 /kernel/trace/trace_events_hist.c
parentx86/mm/kmmio: Use rcu_read_lock_sched_notrace() (diff)
downloadlinux-2cc6a528882d0e0ccbc1bca5f95b8c963cedac54.tar.xz
linux-2cc6a528882d0e0ccbc1bca5f95b8c963cedac54.zip
tracing/hist: Fix wrong return value in parse_action_params()
When number of synth fields is more than SYNTH_FIELDS_MAX, parse_action_params() should return -EINVAL. Link: https://lore.kernel.org/linux-trace-kernel/20221207034635.2253990-1-zhengyejian1@huawei.com Cc: <mhiramat@kernel.org> Cc: <zanussi@kernel.org> Cc: stable@vger.kernel.org Fixes: c282a386a397 ("tracing: Add 'onmatch' hist trigger action support") Signed-off-by: Zheng Yejian <zhengyejian1@huawei.com> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/trace_events_hist.c')
-rw-r--r--kernel/trace/trace_events_hist.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c
index a0cd118af527..b4ad86c22b43 100644
--- a/kernel/trace/trace_events_hist.c
+++ b/kernel/trace/trace_events_hist.c
@@ -3609,6 +3609,7 @@ static int parse_action_params(struct trace_array *tr, char *params,
while (params) {
if (data->n_params >= SYNTH_FIELDS_MAX) {
hist_err(tr, HIST_ERR_TOO_MANY_PARAMS, 0);
+ ret = -EINVAL;
goto out;
}