[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20200206084533.14d4f105e2d45e6a0dcf6527@kernel.org>
Date: Thu, 6 Feb 2020 08:45:33 +0900
From: Masami Hiramatsu <mhiramat@...nel.org>
To: "Gustavo A. R. Silva" <gustavo@...eddedor.com>
Cc: "Steven Rostedt (VMware)" <rostedt@...dmis.org>,
Ingo Molnar <mingo@...hat.com>,
Tom Zanussi <zanussi@...nel.org>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH][next] tracing/kprobe: Fix uninitialized variable bug
On Wed, 5 Feb 2020 16:34:04 -0600
"Gustavo A. R. Silva" <gustavo@...eddedor.com> wrote:
> There is a potential execution path in which variable *ret* is returned
> without being properly initialized, previously.
>
> Fix this by initializing variable *ret* to 0.
Good catch!
Acked-by: Masami Hiramatsu <mhiramat@...nel.org>
Thank you!
>
> Addresses-Coverity-ID: 1491142 ("Uninitialized scalar variable")
> Fixes: 2a588dd1d5d6 ("tracing: Add kprobe event command generation functions")
> Signed-off-by: Gustavo A. R. Silva <gustavo@...eddedor.com>
> ---
> kernel/trace/trace_kprobe.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c
> index d8264ebb9581..362cca52f5de 100644
> --- a/kernel/trace/trace_kprobe.c
> +++ b/kernel/trace/trace_kprobe.c
> @@ -1012,7 +1012,7 @@ int __kprobe_event_add_fields(struct dynevent_cmd *cmd, ...)
> {
> struct dynevent_arg arg;
> va_list args;
> - int ret;
> + int ret = 0;
>
> if (cmd->type != DYNEVENT_TYPE_KPROBE)
> return -EINVAL;
> --
> 2.25.0
>
--
Masami Hiramatsu <mhiramat@...nel.org>
Powered by blists - more mailing lists