From: Jiri Olsa Date: Sat, 10 Nov 2012 00:46:52 +0000 (+0100) Subject: perf tests: Check for mkstemp return value in dso-data test X-Git-Tag: v3.8-rc1~171^2~3^2~20 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=f95e0818cbd026a8f2277895c65fcc9cc5b28cf6;p=karo-tx-linux.git perf tests: Check for mkstemp return value in dso-data test Adding check for mkstemp return error value in dso-data test. Reported-by: Arnaldo Carvalho de Melo Signed-off-by: Jiri Olsa Cc: Corey Ashford Cc: Frederic Weisbecker Cc: Ingo Molnar Cc: Paul Mackerras Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1352508412-16914-13-git-send-email-jolsa@redhat.com Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/tests/dso-data.c b/tools/perf/tests/dso-data.c index b5198f52c24a..5eaffa2de9c5 100644 --- a/tools/perf/tests/dso-data.c +++ b/tools/perf/tests/dso-data.c @@ -26,6 +26,10 @@ static char *test_file(int size) unsigned char *buf; fd = mkstemp(templ); + if (fd < 0) { + perror("mkstemp failed"); + return NULL; + } buf = malloc(size); if (!buf) {