Skip to contentSkip to conversation

perf sched: Fix allocation result check

tip:perf/urgent tip-bot for Arnaldo Carvalho de Melo 1 participant 1 message Jan 11, 2011 perf events

lore
Share & tools
lore
#0 lore raw
Commit-ID:  e462dc553ea5e09d4713e7c35a11ed331dc6f369
Gitweb:     http://git.kernel.org/tip/e462dc553ea5e09d4713e7c35a11ed331dc6f369
Author:     Arnaldo Carvalho de Melo <[email protected]>
AuthorDate: Mon, 10 Jan 2011 10:48:47 -0200
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Mon, 10 Jan 2011 10:48:47 -0200

perf sched: Fix allocation result check

Bug introduced in ce47dc56.

Cc Chris Samuel <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Stephane Eranian <[email protected]>
Cc Tom Zanussi <[email protected]>

LKML-Reference: <new-submission>

---
 tools/perf/builtin-sched.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
tools/perf/builtin-sched.c +1 -1
index 7a4ebeb..54024d2 100644
@@ -1861,7 +1861,7 @@ static int __cmd_record(int argc, const char **argv)
 	rec_argc = ARRAY_SIZE(record_args) + argc - 1;
 	rec_argv = calloc(rec_argc + 1, sizeof(char *));
 
-	if (rec_argv)
+	if (rec_argv == NULL)
 		return -ENOMEM;
 
 	for (i = 0; i < ARRAY_SIZE(record_args); i++)