Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756937Ab2EaLtQ (ORCPT ); Thu, 31 May 2012 07:49:16 -0400 Received: from e28smtp01.in.ibm.com ([122.248.162.1]:52794 "EHLO e28smtp01.in.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754620Ab2EaLtP (ORCPT ); Thu, 31 May 2012 07:49:15 -0400 From: Srikar Dronamraju To: Peter Zijlstra , Ingo Molnar Cc: Linus Torvalds , Ananth N Mavinakayanahalli , LKML , Oleg Nesterov , Steven Rostedt , Arnaldo Carvalho de Melo , Masami Hiramatsu , Anton Arapov Date: Thu, 31 May 2012 17:16:56 +0530 Message-Id: <20120531114656.23691.54223.sendpatchset@srdronam.in.ibm.com> In-Reply-To: <20120531114630.23691.33166.sendpatchset@srdronam.in.ibm.com> References: <20120531114630.23691.33166.sendpatchset@srdronam.in.ibm.com> Subject: [PATCH 3/3] perf: Check for valid dso before creating map x-cbid: 12053111-4790-0000-0000-00000305D392 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1084 Lines: 35 From: Srikar Dronamraju dso__new() can return NULL. Hence verify dso before creating a new map. Suggested-by: Arnaldo Carvalho de Melo Signed-off-by: Srikar Dronamraju --- 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; } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/