public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Check the right return variable
@ 2010-02-25  3:00 Zhang, Yanmin
  2010-02-25  8:46 ` David Miller
  2010-02-25 11:18 ` [tip:perf/core] perf symbols: " tip-bot for Zhang, Yanmin
  0 siblings, 2 replies; 3+ messages in thread
From: Zhang, Yanmin @ 2010-02-25  3:00 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Peter Zijlstra, LKML

In function dso__split_kallsyms, curr_map saves the return value of
map__new2. So check it instead of var map after the calling returns.

Signed-off-by: Zhang Yanmin <yanmin_zhang@linux.intel.com>

---

diff -Nraup linux-2.6.33/tools/perf/util/symbol.c linux-2.6.33_perf/tools/perf/util/symbol.c
--- linux-2.6.33/tools/perf/util/symbol.c	2010-02-25 02:52:17.000000000 +0800
+++ linux-2.6.33_perf/tools/perf/util/symbol.c	2010-02-25 10:12:33.000000000 +0800
@@ -503,7 +503,7 @@ static int dso__split_kallsyms(struct ds
 				return -1;
 
 			curr_map = map__new2(pos->start, dso, map->type);
-			if (map == NULL) {
+			if (curr_map == NULL) {
 				dso__delete(dso);
 				return -1;
 			}



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Check the right return variable
  2010-02-25  3:00 Check the right return variable Zhang, Yanmin
@ 2010-02-25  8:46 ` David Miller
  2010-02-25 11:18 ` [tip:perf/core] perf symbols: " tip-bot for Zhang, Yanmin
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2010-02-25  8:46 UTC (permalink / raw)
  To: yanmin_zhang; +Cc: mingo, a.p.zijlstra, linux-kernel

From: "Zhang, Yanmin" <yanmin_zhang@linux.intel.com>
Date: Thu, 25 Feb 2010 11:00:51 +0800

> In function dso__split_kallsyms, curr_map saves the return value of
> map__new2. So check it instead of var map after the calling returns.
> 
> Signed-off-by: Zhang Yanmin <yanmin_zhang@linux.intel.com>

Acked-by: David S. Miller <davem@davemloft.net>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip:perf/core] perf symbols: Check the right return variable
  2010-02-25  3:00 Check the right return variable Zhang, Yanmin
  2010-02-25  8:46 ` David Miller
@ 2010-02-25 11:18 ` tip-bot for Zhang, Yanmin
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Zhang, Yanmin @ 2010-02-25 11:18 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, acme, paulus, hpa, mingo, a.p.zijlstra, efault,
	yanmin_zhang, davem, fweisbec, tglx, mingo

Commit-ID:  37fe5fcb7a5b5235c8b71bf5469ce4c7246e3fab
Gitweb:     http://git.kernel.org/tip/37fe5fcb7a5b5235c8b71bf5469ce4c7246e3fab
Author:     Zhang, Yanmin <yanmin_zhang@linux.intel.com>
AuthorDate: Thu, 25 Feb 2010 11:00:51 +0800
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Thu, 25 Feb 2010 12:15:24 +0100

perf symbols: Check the right return variable

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 |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index ee9c37e..320b151 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -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;
 			}

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-02-25 11:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-25  3:00 Check the right return variable Zhang, Yanmin
2010-02-25  8:46 ` David Miller
2010-02-25 11:18 ` [tip:perf/core] perf symbols: " tip-bot for Zhang, Yanmin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox