aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/arch/x86/util/header.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/arch/x86/util/header.c')
-rw-r--r--tools/perf/arch/x86/util/header.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/perf/arch/x86/util/header.c b/tools/perf/arch/x86/util/header.c
index 33027c5e6f92..fb0d71afee8b 100644
--- a/tools/perf/arch/x86/util/header.c
+++ b/tools/perf/arch/x86/util/header.c
@@ -66,11 +66,11 @@ get_cpuid(char *buffer, size_t sz)
66} 66}
67 67
68char * 68char *
69get_cpuid_str(void) 69get_cpuid_str(struct perf_pmu *pmu __maybe_unused)
70{ 70{
71 char *buf = malloc(128); 71 char *buf = malloc(128);
72 72
73 if (__get_cpuid(buf, 128, "%s-%u-%X$") < 0) { 73 if (buf && __get_cpuid(buf, 128, "%s-%u-%X$") < 0) {
74 free(buf); 74 free(buf);
75 return NULL; 75 return NULL;
76 } 76 }