* [tip:perf/core] perf tools: Fix wrong condition for allocation failure
@ 2014-07-05 10:42 tip-bot for Jiri Olsa
0 siblings, 0 replies; only message in thread
From: tip-bot for Jiri Olsa @ 2014-07-05 10:42 UTC (permalink / raw)
To: linux-tip-commits
Cc: linux-kernel, paulus, hpa, mingo, jolsa, a.p.zijlstra, acme,
namhyung, fweisbec, dsahern, tglx, cjashfor
Commit-ID: d180ac14a95d738c2d2622db82c2212a8f998200
Gitweb: http://git.kernel.org/tip/d180ac14a95d738c2d2622db82c2212a8f998200
Author: Jiri Olsa <jolsa@kernel.org>
AuthorDate: Fri, 20 Jun 2014 10:56:34 +0200
Committer: Jiri Olsa <jolsa@kernel.org>
CommitDate: Fri, 27 Jun 2014 11:14:54 +0200
perf tools: Fix wrong condition for allocation failure
Check real allocated pointer for NULL.
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/n/tip-5rfzbalwjphmdzzil74eazyl@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
tools/perf/builtin-stat.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 65a151e..3e80aa1 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -184,7 +184,7 @@ static void perf_evsel__reset_stat_priv(struct perf_evsel *evsel)
static int perf_evsel__alloc_stat_priv(struct perf_evsel *evsel)
{
evsel->priv = zalloc(sizeof(struct perf_stat));
- if (evsel == NULL)
+ if (evsel->priv == NULL)
return -ENOMEM;
perf_evsel__reset_stat_priv(evsel);
return 0;
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2014-07-05 10:42 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-05 10:42 [tip:perf/core] perf tools: Fix wrong condition for allocation failure tip-bot for Jiri Olsa
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox