From: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
To: Peter Zijlstra <peterz@infradead.org>, Ingo Molnar <mingo@elte.hu>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Ananth N Mavinakayanahalli <ananth@in.ibm.com>,
LKML <linux-kernel@vger.kernel.org>,
Oleg Nesterov <oleg@redhat.com>,
Steven Rostedt <rostedt@goodmis.org>,
Arnaldo Carvalho de Melo <acme@infradead.org>,
Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
Anton Arapov <anton@redhat.com>
Subject: [PATCH 3/3] perf: Check for valid dso before creating map
Date: Thu, 31 May 2012 17:16:56 +0530 [thread overview]
Message-ID: <20120531114656.23691.54223.sendpatchset@srdronam.in.ibm.com> (raw)
In-Reply-To: <20120531114630.23691.33166.sendpatchset@srdronam.in.ibm.com>
From: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
dso__new() can return NULL. Hence verify dso before creating
a new map.
Suggested-by: Arnaldo Carvalho de Melo <acme@infradead.org>
Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
---
tools/perf/util/symbol.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index e2ba885..0ef529e 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -2786,8 +2786,11 @@ int machine__load_vmlinux_path(struct machine *machine, enum map_type type,
struct map *dso__new_map(const char *name)
{
+ struct map *map = NULL;
struct dso *dso = dso__new(name);
- struct map *map = map__new2(0, dso, MAP__FUNCTION);
+
+ if (dso)
+ map = map__new2(0, dso, MAP__FUNCTION);
return map;
}
next prev parent reply other threads:[~2012-05-31 11:49 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-31 11:46 [PATCH 1/3] uprobes/core: Remove redundant lock_page/unlock_page Srikar Dronamraju
2012-05-31 11:46 ` [PATCH 2/3] perf/uprobes: Remove unnecessary check before strlist__delete Srikar Dronamraju
2012-06-06 7:08 ` [tip:perf/urgent] perf uprobes: " tip-bot for Srikar Dronamraju
2012-05-31 11:46 ` Srikar Dronamraju [this message]
2012-06-06 7:07 ` [tip:perf/urgent] perf symbols: Check for valid dso before creating map tip-bot for Srikar Dronamraju
2012-05-31 11:58 ` [PATCH 1/3] uprobes/core: Remove redundant lock_page/unlock_page Peter Zijlstra
2012-05-31 14:22 ` Steven Rostedt
2012-05-31 15:07 ` Srikar Dronamraju
2012-05-31 16:56 ` Peter Zijlstra
2012-05-31 16:58 ` Srikar Dronamraju
2012-06-01 9:19 ` [RESEND PATCH 1/3] uprobes: " Srikar Dronamraju
2012-06-01 18:52 ` Oleg Nesterov
2012-06-06 9:18 ` Ingo Molnar
2012-06-06 9:19 ` Peter Zijlstra
2012-08-06 11:57 ` Anton Arapov
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=20120531114656.23691.54223.sendpatchset@srdronam.in.ibm.com \
--to=srikar@linux.vnet.ibm.com \
--cc=acme@infradead.org \
--cc=ananth@in.ibm.com \
--cc=anton@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=masami.hiramatsu.pt@hitachi.com \
--cc=mingo@elte.hu \
--cc=oleg@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=torvalds@linux-foundation.org \
/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
Powered by JetHome