From: Zheng Yejian Date: Wed, 7 Dec 2022 03:46:35 +0000 (+0800) Subject: tracing/hist: Fix wrong return value in parse_action_params() X-Git-Tag: v6.2-rc1~73^2~19 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2cc6a528882d0e0ccbc1bca5f95b8c963cedac54;p=thirdparty%2Flinux.git 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: Cc: Cc: stable@vger.kernel.org Fixes: c282a386a397 ("tracing: Add 'onmatch' hist trigger action support") Signed-off-by: Zheng Yejian Signed-off-by: Steven Rostedt (Google) --- diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c index a0cd118af5272..b4ad86c22b43a 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; }