* [PATCH] tools: lib: traceevent: event-parse.c: Fix a risk for doing free on uninitialized pointer
@ 2014-06-24 11:09 Rickard Strandqvist
2014-06-25 1:04 ` Namhyung Kim
2014-07-05 10:41 ` [tip:perf/core] tools lib traceevent: " tip-bot for Rickard Strandqvist
0 siblings, 2 replies; 4+ messages in thread
From: Rickard Strandqvist @ 2014-06-24 11:09 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo, Steven Rostedt
Cc: Rickard Strandqvist, Jiri Olsa, Namhyung Kim, Yoshihiro YUNOMAE,
Howard Cochran, linux-kernel
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>
---
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;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] tools: lib: traceevent: event-parse.c: Fix a risk for doing free on uninitialized pointer
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
2014-06-25 7:33 ` Jiri Olsa
2014-07-05 10:41 ` [tip:perf/core] tools lib traceevent: " tip-bot for Rickard Strandqvist
1 sibling, 1 reply; 4+ messages in thread
From: Namhyung Kim @ 2014-06-25 1:04 UTC (permalink / raw)
To: Rickard Strandqvist
Cc: Arnaldo Carvalho de Melo, Steven Rostedt, Jiri Olsa,
Yoshihiro YUNOMAE, Howard Cochran, linux-kernel
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;
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] tools: lib: traceevent: event-parse.c: Fix a risk for doing free on uninitialized pointer
2014-06-25 1:04 ` Namhyung Kim
@ 2014-06-25 7:33 ` Jiri Olsa
0 siblings, 0 replies; 4+ messages in thread
From: Jiri Olsa @ 2014-06-25 7:33 UTC (permalink / raw)
To: Namhyung Kim
Cc: Rickard Strandqvist, Arnaldo Carvalho de Melo, Steven Rostedt,
Yoshihiro YUNOMAE, Howard Cochran, linux-kernel
On Wed, Jun 25, 2014 at 10:04:47AM +0900, Namhyung Kim wrote:
> 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, queued
jirka
^ permalink raw reply [flat|nested] 4+ messages in thread
* [tip:perf/core] tools lib traceevent: Fix a risk for doing free on uninitialized pointer
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
@ 2014-07-05 10:41 ` tip-bot for Rickard Strandqvist
1 sibling, 0 replies; 4+ messages in thread
From: tip-bot for Rickard Strandqvist @ 2014-07-05 10:41 UTC (permalink / raw)
To: linux-tip-commits
Cc: linux-kernel, rickard_strandqvist, hpa, mingo, jolsa, tglx,
namhyung
Commit-ID: 21da83fb6c3ff67e969b8770bbb33138c9ede88e
Gitweb: http://git.kernel.org/tip/21da83fb6c3ff67e969b8770bbb33138c9ede88e
Author: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
AuthorDate: Tue, 24 Jun 2014 13:09:10 +0200
Committer: Jiri Olsa <jolsa@kernel.org>
CommitDate: Fri, 27 Jun 2014 11:14:47 +0200
tools lib traceevent: Fix a risk for doing free on uninitialized pointer
Fix a risk of doing free on an uninitialized pointer.
This was found using a static code analysis program called cppcheck.
Acked-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Link: http://lkml.kernel.org/r/1403608150-13037-1-git-send-email-rickard_strandqvist@spectrumdigital.se
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
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 93825a1..cf3a44b 100644
--- a/tools/lib/traceevent/event-parse.c
+++ b/tools/lib/traceevent/event-parse.c
@@ -2395,7 +2395,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;
@@ -2448,7 +2448,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;
@@ -2487,7 +2487,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;
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-07-05 10:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2014-06-25 7:33 ` Jiri Olsa
2014-07-05 10:41 ` [tip:perf/core] tools lib traceevent: " tip-bot for Rickard Strandqvist
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox