diff --git a/tools/perf/tests/dso-data.c b/tools/perf/tests/dso-data.c index b5198f52c24a5c1ee3f50f3b824a370c6522a94e..5eaffa2de9c5816399a2b455f25857fec46a9613 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) {