aboutsummaryrefslogtreecommitdiff
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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/arch/x86/util/header.c b/tools/perf/arch/x86/util/header.c
index a74a48db26f5..2eb11543e2e9 100644
--- a/tools/perf/arch/x86/util/header.c
+++ b/tools/perf/arch/x86/util/header.c
@@ -69,7 +69,7 @@ get_cpuid_str(void)
{
char *buf = malloc(128);
- if (__get_cpuid(buf, 128, "%s-%u-%X$") < 0) {
+ if (buf && __get_cpuid(buf, 128, "%s-%u-%X$") < 0) {
free(buf);
return NULL;
}