LKML Archive on
help / color / mirror / Atom feed
From: Dan Carpenter <>
To: Steven Rostedt <>,
	Tom Zanussi <>
Cc: Ingo Molnar <>,,
Subject: [PATCH] tracing: Fix a potential NULL dereference
Date: Fri, 23 Mar 2018 14:37:36 +0300	[thread overview]
Message-ID: <20180323113735.GC28518@mwanda> (raw)

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.

Fixes: 100719dcef44 ("tracing: Add simple expression support to hist triggers")
Signed-off-by: Dan Carpenter <>

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;
+		ret = -EINVAL;
 		goto free;

             reply	other threads:[~2018-03-23 11:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-23 11:37 Dan Carpenter [this message]
2018-03-23 13:23 ` Tom Zanussi
2018-03-23 15:14   ` Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180323113735.GC28518@mwanda \ \ \ \ \ \ \
    --subject='Re: [PATCH] tracing: Fix a potential NULL dereference' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).