aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Olsa <[email protected]>2012-11-10 01:46:52 +0100
committerArnaldo Carvalho de Melo <[email protected]>2012-11-14 16:50:30 -0300
commitf95e0818cbd026a8f2277895c65fcc9cc5b28cf6 (patch)
tree1006699f08da33eb8bf797e5bbb50cd09f482962
parentc81251e808fe2386e71990ecd49c408bb7cb4666 (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 <[email protected]> Signed-off-by: Jiri Olsa <[email protected]> Cc: Corey Ashford <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
-rw-r--r--tools/perf/tests/dso-data.c4
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)
unsigned char *buf;
fd = mkstemp(templ);
+ if (fd < 0) {
+ perror("mkstemp failed");
+ return NULL;
+ }
buf = malloc(size);
if (!buf) {