Re: [PATCH] tracing: Fix error handling in event_hist_trigger_parse

From: Steven Rostedt

Date: Thu Dec 11 2025 - 20:45:36 EST


On Thu, 11 Dec 2025 14:00:58 +0400
Miaoqian Lin <linmq006@xxxxxxxxx> wrote:

> @@ -6902,7 +6902,7 @@ static int event_hist_trigger_parse(struct event_command *cmd_ops,
>
> remove_hist_vars(hist_data);
>
> - kfree(trigger_data);
> + trigger_data_free(trigger_data);
>
> destroy_hist_data(hist_data);
> goto out;

The above code has this:

out_free:
event_trigger_reset_filter(cmd_ops, trigger_data);

remove_hist_vars(hist_data);

kfree(trigger_data);

destroy_hist_data(hist_data);
goto out;

Where we have;

void event_trigger_reset_filter(struct event_command *cmd_ops,
struct event_trigger_data *trigger_data)
{
if (cmd_ops->set_filter)
cmd_ops->set_filter(NULL, trigger_data, NULL);
}

And trigger_data_free() starts with:

void trigger_data_free(struct event_trigger_data *data)
{
if (data->cmd_ops->set_filter)
data->cmd_ops->set_filter(NULL, data, NULL);


thus it looks like the current code is an open coded version of
trigger_data_free() without synchronization (as it isn't needed here).

Thus, I believe this is more of a clean up and not a fix (something to
go into the next merge window and not the current -rc release).

And the code can be changed to also remove the event_trigger_reset_filter()
call.

-- Steve