diff options
-rw-r--r-- | tools/perf/util/trace-event-info.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/perf/util/trace-event-info.c b/tools/perf/util/trace-event-info.c index 535176dc95b6..407fd65b6cdb 100644 --- a/tools/perf/util/trace-event-info.c +++ b/tools/perf/util/trace-event-info.c | |||
@@ -253,6 +253,8 @@ static void read_header_files(void) | |||
253 | write_or_die("header_page", 12); | 253 | write_or_die("header_page", 12); |
254 | write_or_die(&size, 8); | 254 | write_or_die(&size, 8); |
255 | check_size = copy_file_fd(fd); | 255 | check_size = copy_file_fd(fd); |
256 | close(fd); | ||
257 | |||
256 | if (size != check_size) | 258 | if (size != check_size) |
257 | die("wrong size for '%s' size=%lld read=%lld", | 259 | die("wrong size for '%s' size=%lld read=%lld", |
258 | path, size, check_size); | 260 | path, size, check_size); |
@@ -271,6 +273,7 @@ static void read_header_files(void) | |||
271 | if (size != check_size) | 273 | if (size != check_size) |
272 | die("wrong size for '%s'", path); | 274 | die("wrong size for '%s'", path); |
273 | put_tracing_file(path); | 275 | put_tracing_file(path); |
276 | close(fd); | ||
274 | } | 277 | } |
275 | 278 | ||
276 | static bool name_in_tp_list(char *sys, struct tracepoint_path *tps) | 279 | static bool name_in_tp_list(char *sys, struct tracepoint_path *tps) |
@@ -337,6 +340,7 @@ static void copy_event_system(const char *sys, struct tracepoint_path *tps) | |||
337 | 340 | ||
338 | free(format); | 341 | free(format); |
339 | } | 342 | } |
343 | closedir(dir); | ||
340 | } | 344 | } |
341 | 345 | ||
342 | static void read_ftrace_files(struct tracepoint_path *tps) | 346 | static void read_ftrace_files(struct tracepoint_path *tps) |
@@ -407,6 +411,7 @@ static void read_event_files(struct tracepoint_path *tps) | |||
407 | free(sys); | 411 | free(sys); |
408 | } | 412 | } |
409 | 413 | ||
414 | closedir(dir); | ||
410 | put_tracing_file(path); | 415 | put_tracing_file(path); |
411 | } | 416 | } |
412 | 417 | ||