From: "Steven Rostedt (VMware)" <rostedt@xxxxxxxxxxx> If the instance ftrace_filter_fd is open on freeing of the instance, close it. Link: https://lore.kernel.org/linux-trace-devel/20210408085340.5e84064f@xxxxxxxxxxxxxxxxxx/ Suggested-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@xxxxxxxxx> Signed-off-by: Steven Rostedt (VMware) <rostedt@xxxxxxxxxxx> --- src/tracefs-instance.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/tracefs-instance.c b/src/tracefs-instance.c index bf2fabf..e222191 100644 --- a/src/tracefs-instance.c +++ b/src/tracefs-instance.c @@ -66,6 +66,10 @@ void tracefs_instance_free(struct tracefs_instance *instance) { if (!instance) return; + + if (instance->ftrace_filter_fd >= 0) + close(instance->ftrace_filter_fd); + free(instance->trace_dir); free(instance->name); free(instance); -- 2.29.2