diff options
author | Jiri Olsa <jolsa@redhat.com> | 2012-11-09 19:46:52 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-11-14 14:50:30 -0500 |
commit | f95e0818cbd026a8f2277895c65fcc9cc5b28cf6 (patch) | |
tree | 1006699f08da33eb8bf797e5bbb50cd09f482962 | |
parent | c81251e808fe2386e71990ecd49c408bb7cb4666 (diff) |
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 <acme@redhat.com>
Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1352508412-16914-13-git-send-email-jolsa@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/perf/tests/dso-data.c | 4 |
1 files changed, 4 insertions, 0 deletions
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) | |||
26 | unsigned char *buf; | 26 | unsigned char *buf; |
27 | 27 | ||
28 | fd = mkstemp(templ); | 28 | fd = mkstemp(templ); |
29 | if (fd < 0) { | ||
30 | perror("mkstemp failed"); | ||
31 | return NULL; | ||
32 | } | ||
29 | 33 | ||
30 | buf = malloc(size); | 34 | buf = malloc(size); |
31 | if (!buf) { | 35 | if (!buf) { |