From: Steven Rostedt <rostedt@goodmis.org>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Ingo Molnar <mingo@redhat.com>,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH 2/2] ftrace: silence uninitialized variable warning
Date: Wed, 12 Jul 2017 09:45:01 -0400 [thread overview]
Message-ID: <20170712094501.4579732f@gandalf.local.home> (raw)
In-Reply-To: <20170712073556.h6tkpjcdzjaozozs@mwanda>
On Wed, 12 Jul 2017 10:35:57 +0300
Dan Carpenter <dan.carpenter@oracle.com> wrote:
> My static checker complains that if "func" is NULL then "clear_filter"
> is uninitialized. This seems like it could be true, although it's
> possible something subtle is happening that I haven't seen.
>
> kernel/trace/ftrace.c:3844 match_records()
> error: uninitialized symbol 'clear_filter'.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> It does occur to me that I could initialize it to 1 instead of 0 but my
> guess is that zero is intended. Please review this one carefully.
Looks like it broke with f0a3b154bd7 ("ftrace: Clarify code for mod
command"). Yeah, clear_filter = 0 is the correct default.
Thanks!
-- Steve
>
> diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
> index 2a3c45743f54..5e658da91912 100644
> --- a/kernel/trace/ftrace.c
> +++ b/kernel/trace/ftrace.c
> @@ -3816,7 +3816,7 @@ match_records(struct ftrace_hash *hash, char *func, int len, char *mod)
> int exclude_mod = 0;
> int found = 0;
> int ret;
> - int clear_filter;
> + int clear_filter = 0;
>
> if (func) {
> func_g.type = filter_parse_regex(func, len, &func_g.search,
prev parent reply other threads:[~2017-07-12 13:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-12 7:33 [PATCH 1/2] ftrace: remove an unneeded NULL check Dan Carpenter
2017-07-12 7:35 ` [PATCH 2/2] ftrace: silence uninitialized variable warning Dan Carpenter
2017-07-12 13:45 ` Steven Rostedt [this message]
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=20170712094501.4579732f@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox