aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-sched.c
diff options
context:
space:
mode:
authorChris Samuel <chris@csamuel.org>2010-11-12 21:35:06 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2010-12-06 09:52:35 -0500
commitce47dc56a2241dc035160a85bc5e34283cdd622c (patch)
treed9404df9d3ca0ddacdd8faae791ece27206dece4 /tools/perf/builtin-sched.c
parent965bb6beaf70862d3846e330ea7a14996d82c499 (diff)
perf tools: Catch a few uncheck calloc/malloc's
There were a few stray calloc()'s and malloc()'s which were not having their return values checked for success. As the calling code either already coped with failure or didn't actually care we just return -ENOMEM at that point. Cc: Ingo Molnar <mingo@elte.hu> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Chris Samuel <chris@csamuel.org> LKML-Reference: <4CDDF95A.1050400@csamuel.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-sched.c')
-rw-r--r--tools/perf/builtin-sched.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
index 73d1e30b0fed..c7753940aea0 100644
--- a/tools/perf/builtin-sched.c
+++ b/tools/perf/builtin-sched.c
@@ -1860,6 +1860,9 @@ static int __cmd_record(int argc, const char **argv)
1860 rec_argc = ARRAY_SIZE(record_args) + argc - 1; 1860 rec_argc = ARRAY_SIZE(record_args) + argc - 1;
1861 rec_argv = calloc(rec_argc + 1, sizeof(char *)); 1861 rec_argv = calloc(rec_argc + 1, sizeof(char *));
1862 1862
1863 if (rec_argv)
1864 return -ENOMEM;
1865
1863 for (i = 0; i < ARRAY_SIZE(record_args); i++) 1866 for (i = 0; i < ARRAY_SIZE(record_args); i++)
1864 rec_argv[i] = strdup(record_args[i]); 1867 rec_argv[i] = strdup(record_args[i]);
1865 1868