]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
tracing: Fix error handling in event_trigger_parse()
authorMiaoqian Lin <linmq006@gmail.com>
Wed, 7 May 2025 14:53:07 +0000 (10:53 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Jun 2025 10:07:10 +0000 (11:07 +0100)
[ Upstream commit c5dd28e7fb4f63475b50df4f58311df92939d011 ]

According to trigger_data_alloc() doc, trigger_data_free() should be
used to free an event_trigger_data object. This fixes a mismatch introduced
when kzalloc was replaced with trigger_data_alloc without updating
the corresponding deallocation calls.

Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Tom Zanussi <zanussi@kernel.org>
Link: https://lore.kernel.org/20250507145455.944453325@goodmis.org
Link: https://lore.kernel.org/20250318112737.4174-1-linmq006@gmail.com
Fixes: e1f187d09e11 ("tracing: Have existing event_command.parse() implementations use helpers")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
[ SDR: Changed event_trigger_alloc/free() to trigger_data_alloc/free() ]
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/trace/trace_events_trigger.c

index 22bee3eae7cc37f69ab1642888c69545b8a11aed..782ccb2433bb4622ba36594ae3249ee0b35aeecb 100644 (file)
@@ -998,7 +998,7 @@ event_trigger_parse(struct event_command *cmd_ops,
 
        if (remove) {
                event_trigger_unregister(cmd_ops, file, glob+1, trigger_data);
-               kfree(trigger_data);
+               trigger_data_free(trigger_data);
                ret = 0;
                goto out;
        }
@@ -1025,7 +1025,7 @@ event_trigger_parse(struct event_command *cmd_ops,
 
  out_free:
        event_trigger_reset_filter(cmd_ops, trigger_data);
-       kfree(trigger_data);
+       trigger_data_free(trigger_data);
        goto out;
 }