perf sched: Fix allocation result check
authorArnaldo Carvalho de Melo <[email protected]>
Mon, 10 Jan 2011 12:48:47 +0000 (10:48 -0200)
committerArnaldo Carvalho de Melo <[email protected]>
Mon, 10 Jan 2011 12:48:47 +0000 (10:48 -0200)
Bug introduced in ce47dc56.

Reported-by: Mike Galbraith <[email protected]>
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>
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
tools/perf/builtin-sched.c

index 7a4ebeb8b016b4ca01c14f393b3c5fab98567523..54024d2a017e3ace0d121565f535a03afbc2e062 100644 (file)
@@ -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++)