diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2018-03-23 14:37:36 +0300 |
---|---|---|
committer | Steven Rostedt (VMware) <rostedt@goodmis.org> | 2018-03-23 11:15:20 -0400 |
commit | 5e4cf2bf6d1c198a90ccc0df5ffd8e0d4ea36b48 (patch) | |
tree | 6d012d3b94aeadeca4d782f2634c01230a12a247 /kernel/trace/trace_events_hist.c | |
parent | 80765597bc587feae8dbc8ce97a0f32e12a6e625 (diff) | |
download | linux-5e4cf2bf6d1c198a90ccc0df5ffd8e0d4ea36b48.tar.bz2 |
tracing: Fix a potential NULL dereference
We forgot to set the error code on this path so we return ERR_PTR(0)
which is NULL. It results in a NULL dereference in the caller.
Link: http://lkml.kernel.org/r/20180323113735.GC28518@mwanda
Fixes: 100719dcef44 ("tracing: Add simple expression support to hist triggers")
Acked-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/trace_events_hist.c')
-rw-r--r-- | kernel/trace/trace_events_hist.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c index 4f027642ceef..a02bc09d765a 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -2776,6 +2776,7 @@ static struct hist_field *parse_expr(struct hist_trigger_data *hist_data, expr->fn = hist_field_plus; break; default: + ret = -EINVAL; goto free; } |