aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/perf/util/machine.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index f5569f005cf3..17eec39e775e 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -1241,9 +1241,9 @@ static char *get_kernel_version(const char *root_dir)
1241 return NULL; 1241 return NULL;
1242 1242
1243 tmp = fgets(version, sizeof(version), file); 1243 tmp = fgets(version, sizeof(version), file);
1244 if (!tmp)
1245 *version = '\0';
1246 fclose(file); 1244 fclose(file);
1245 if (!tmp)
1246 return NULL;
1247 1247
1248 name = strstr(version, prefix); 1248 name = strstr(version, prefix);
1249 if (!name) 1249 if (!name)