perf symbols: Check the right return variable
authorZhang, Yanmin <yanmin_zhang@linux.intel.com>
Thu, 25 Feb 2010 03:00:51 +0000 (11:00 +0800)
committerIngo Molnar <mingo@elte.hu>
Thu, 25 Feb 2010 11:15:24 +0000 (12:15 +0100)
In function dso__split_kallsyms(), curr_map saves the return value
of map__new2. So check it instead of var map after the call returns.

Signed-off-by: Zhang Yanmin <yanmin_zhang@linux.intel.com>
Acked-by: David S. Miller <davem@davemloft.net>
Cc: <stable@kernel.org> # for .33.x
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <1267066851.1726.9.camel@localhost>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
tools/perf/util/symbol.c

index ee9c37efdd36d15de2ebfc5240e4c3ae8761d897..320b15178e95533461a55a54aade1736f88ed404 100644 (file)
@@ -527,7 +527,7 @@ static int dso__split_kallsyms(struct dso *self, struct map *map,
                                return -1;
 
                        curr_map = map__new2(pos->start, dso, map->type);
-                       if (map == NULL) {
+                       if (curr_map == NULL) {
                                dso__delete(dso);
                                return -1;
                        }