From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Gautam Menghani <gautammenghani201@gmail.com>,
mingo@redhat.com, linux-kernel@vger.kernel.org,
linux-kernel-mentees@lists.linuxfoundation.org,
skhan@linuxfoundation.org, Masami Hiramatsu <mhiramat@kernel.org>
Subject: Re: [PATCH] kernel/trace: Initialize integer variable to prevent garbage return value
Date: Thu, 26 May 2022 23:54:35 +0900 [thread overview]
Message-ID: <20220526235435.59a1b3074ecfb30825824948@kernel.org> (raw)
In-Reply-To: <20220525112551.37e86da6@gandalf.local.home>
On Wed, 25 May 2022 11:25:51 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:
> On Sat, 21 May 2022 23:18:26 -0700
> Gautam Menghani <gautammenghani201@gmail.com> wrote:
>
> > Initialize the integer variable to 0 to fix the clang scan warning:
> > Undefined or garbage value returned to caller
> > [core.uninitialized.UndefReturn]
> > return ret;
> >
> > Signed-off-by: Gautam Menghani <gautammenghani201@gmail.com>
> > ---
> > kernel/trace/trace_boot.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/kernel/trace/trace_boot.c b/kernel/trace/trace_boot.c
> > index 0580287d7a0d..778200dd8ede 100644
> > --- a/kernel/trace/trace_boot.c
> > +++ b/kernel/trace/trace_boot.c
> > @@ -300,7 +300,7 @@ trace_boot_hist_add_handlers(struct xbc_node *hnode, char **bufp,
> > {
> > struct xbc_node *node;
> > const char *p, *handler;
> > - int ret;
> > + int ret = 0;
>
> Looks good to me. Masami, care to ack it?
Thanks! This looks good to me.
Fixes: 8993665abcce ("tracing/boot: Support multiple handlers for per-event histogram")
Cc: stable@vger.kernel.org
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Thank you!
>
> -- Steve
>
> >
> > handler = xbc_node_get_data(hnode);
> >
>
--
Masami Hiramatsu (Google) <mhiramat@kernel.org>
prev parent reply other threads:[~2022-05-26 14:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-22 6:18 Gautam Menghani
2022-05-25 15:25 ` Steven Rostedt
2022-05-26 14:54 ` Masami Hiramatsu [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=20220526235435.59a1b3074ecfb30825824948@kernel.org \
--to=mhiramat@kernel.org \
--cc=gautammenghani201@gmail.com \
--cc=linux-kernel-mentees@lists.linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=rostedt@goodmis.org \
--cc=skhan@linuxfoundation.org \
/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
all inboxes | Powered by JetHome®