Re: [PATCH v5 15/37] tracing: Add variable support to hist triggers
From: Steven Rostedt <rostedt@goodmis.org>
Date: 2017-11-10 13:24:19
Also in:
lkml
From: Steven Rostedt <rostedt@goodmis.org>
Date: 2017-11-10 13:24:19
Also in:
lkml
On Fri, 10 Nov 2017 16:28:41 +0900 Namhyung Kim [off-list ref] wrote:
quoted
+ hist_data->attrs->var_defs.expr[n_vars++] = s; + + hist_data->attrs->var_defs.n_vars = n_vars; + + if (n_vars == TRACING_MAP_VARS_MAX) + goto free;This will silently discard all variables. Why not returning an error? Also I think it should be moved to the beginning of this block..
Right, because the check here is already too late. Usually you check the count before doing the assignment. if (n_vars == TRACING_MAP_VARS_MAX) goto free; hist_data->attrs->var_defs.expr[n_vars++] = s; Because it is OK for n_vars to equal TRACING_MAP_VARS_MAX, but not OK to be more. -- Steve