LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Tom Zanussi <tom.zanussi@linux.intel.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Steven Rostedt <rostedt@goodmis.org>,
Ingo Molnar <mingo@redhat.com>,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] tracing: Fix a potential NULL dereference
Date: Fri, 23 Mar 2018 08:23:13 -0500 [thread overview]
Message-ID: <1521811393.27781.2.camel@tzanussi-mobl.amr.corp.intel.com> (raw)
In-Reply-To: <20180323113735.GC28518@mwanda>
Hi Dan,
On Fri, 2018-03-23 at 14:37 +0300, Dan Carpenter wrote:
> 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 <dan.carpenter@oracle.com>
>
> 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;
> }
>
Acked-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Thanks for catching this!
Tom
next prev parent reply other threads:[~2018-03-23 13:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-23 11:37 Dan Carpenter
2018-03-23 13:23 ` Tom Zanussi [this message]
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:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1521811393.27781.2.camel@tzanussi-mobl.amr.corp.intel.com \
--to=tom.zanussi@linux.intel.com \
--cc=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=rostedt@goodmis.org \
--subject='Re: [PATCH] tracing: Fix a potential NULL dereference' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* 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).