From: Namhyung Kim <namhyung@kernel.org>
To: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>,
Steven Rostedt <rostedt@goodmis.org>,
Jiri Olsa <jolsa@redhat.com>,
Yoshihiro YUNOMAE <yoshihiro.yunomae.ez@hitachi.com>,
Howard Cochran <hcochran@lexmark.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] tools: lib: traceevent: event-parse.c: Fix a risk for doing free on uninitialized pointer
Date: Wed, 25 Jun 2014 10:04:47 +0900 [thread overview]
Message-ID: <87oaxh6bps.fsf@sejong.aot.lge.com> (raw)
In-Reply-To: <1403608150-13037-1-git-send-email-rickard_strandqvist@spectrumdigital.se> (Rickard Strandqvist's message of "Tue, 24 Jun 2014 13:09:10 +0200")
Hi Rickard,
On Tue, 24 Jun 2014 13:09:10 +0200, Rickard Strandqvist wrote:
> Fix a risk of doing free on an uninitialized pointer.
>
> This was found using a static code analysis program called cppcheck.
>
> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Thanks,
Namhyung
> ---
> tools/lib/traceevent/event-parse.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
> index b83184f..857675e 100644
> --- a/tools/lib/traceevent/event-parse.c
> +++ b/tools/lib/traceevent/event-parse.c
> @@ -2390,7 +2390,7 @@ process_flags(struct event_format *event, struct print_arg *arg, char **tok)
> {
> struct print_arg *field;
> enum event_type type;
> - char *token;
> + char *token = NULL;
>
> memset(arg, 0, sizeof(*arg));
> arg->type = PRINT_FLAGS;
> @@ -2443,7 +2443,7 @@ process_symbols(struct event_format *event, struct print_arg *arg, char **tok)
> {
> struct print_arg *field;
> enum event_type type;
> - char *token;
> + char *token = NULL;
>
> memset(arg, 0, sizeof(*arg));
> arg->type = PRINT_SYMBOL;
> @@ -2482,7 +2482,7 @@ process_hex(struct event_format *event, struct print_arg *arg, char **tok)
> {
> struct print_arg *field;
> enum event_type type;
> - char *token;
> + char *token = NULL;
>
> memset(arg, 0, sizeof(*arg));
> arg->type = PRINT_HEX;
next prev parent reply other threads:[~2014-06-25 1:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-24 11:09 [PATCH] tools: lib: traceevent: event-parse.c: Fix a risk for doing free on uninitialized pointer Rickard Strandqvist
2014-06-25 1:04 ` Namhyung Kim [this message]
2014-06-25 7:33 ` Jiri Olsa
2014-07-05 10:41 ` [tip:perf/core] tools lib traceevent: " tip-bot for Rickard Strandqvist
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=87oaxh6bps.fsf@sejong.aot.lge.com \
--to=namhyung@kernel.org \
--cc=acme@redhat.com \
--cc=hcochran@lexmark.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rickard_strandqvist@spectrumdigital.se \
--cc=rostedt@goodmis.org \
--cc=yoshihiro.yunomae.ez@hitachi.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