perf tools: Assign default value for some pointers
authorMartin Liška <mliska@suse.cz>
Tue, 26 May 2015 14:41:37 +0000 (11:41 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 27 May 2015 15:21:45 +0000 (12:21 -0300)
Assign default value for pointers that are identified by the compiler as
non-initialized.

Signed-off-by: Martin Liska <mliska@suse.cz>
Acked-by: Ingo Molnar <mingo@kernel.org>
Link: http://lkml.kernel.org/r/5564393C.1090104@suse.cz
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/arch/common.c
tools/perf/util/symbol.c
tools/perf/util/trace-event-parse.c

index 49776f190abfab295920534840aa1df479a4c094..b7bb42c4469401d76527264f5e538b363b1d4bf9 100644 (file)
@@ -61,7 +61,7 @@ const char *const mips_triplets[] = {
 static bool lookup_path(char *name)
 {
        bool found = false;
-       char *path, *tmp;
+       char *path, *tmp = NULL;
        char buf[PATH_MAX];
        char *env = getenv("PATH");
 
index 00b6b17e74a749089c1885b3506d4ad7af44f9d9..b9e3eb5818840d98aff2db17c4d1f5630e32004c 100644 (file)
@@ -398,7 +398,7 @@ static struct symbol *symbols__find_by_name(struct rb_root *symbols,
                                            const char *name)
 {
        struct rb_node *n;
-       struct symbol_name_rb_node *s;
+       struct symbol_name_rb_node *s = NULL;
 
        if (symbols == NULL)
                return NULL;
index 25d6c737be3e673db1904104a83286c5fbda0b40..d4957418657ec3ab88cce7f77b70095ff21d62c8 100644 (file)
@@ -173,7 +173,7 @@ void parse_ftrace_printk(struct pevent *pevent,
        char *line;
        char *next = NULL;
        char *addr_str;
-       char *fmt;
+       char *fmt = NULL;
 
        line = strtok_r(file, "\n", &next);
        while (line) {