tracing: Fix error handling in event_trigger_parse()
[ Upstream commitc5dd28e7fb] 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:e1f187d09e("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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
ae015964d7
commit
94ade4147a
@@ -1000,7 +1000,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;
|
||||
}
|
||||
@@ -1027,7 +1027,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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user