Commit f95e0818cbd026a8f2277895c65fcc9cc5b28cf6

Authored by Jiri Olsa
Committed by Arnaldo Carvalho de Melo
1 parent c81251e808

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>

Showing 1 changed file with 4 additions and 0 deletions Side-by-side Diff

tools/perf/tests/dso-data.c
... ... @@ -26,6 +26,10 @@
26 26 unsigned char *buf;
27 27  
28 28 fd = mkstemp(templ);
  29 + if (fd < 0) {
  30 + perror("mkstemp failed");
  31 + return NULL;
  32 + }
29 33  
30 34 buf = malloc(size);
31 35 if (!buf) {