On Thu, 11 Dec 2025 14:00:58 +0400
Miaoqian Lin <[email protected]> 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

Reply via email to