On Thu, 30 Jun 2022 09:31:37 +0800 Zheng Yejian <zhengyejian1@xxxxxxxxxx> wrote: > diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c > index 48e82e141d54..2784951e0fc8 100644 > --- a/kernel/trace/trace_events_hist.c > +++ b/kernel/trace/trace_events_hist.c > @@ -4430,6 +4430,7 @@ static int parse_var_defs(struct hist_trigger_data *hist_data) > > s = kstrdup(field_str, GFP_KERNEL); > if (!s) { > + kfree(hist_data->attrs->var_defs.name[n_vars]); Instead of doing just a revert, can we also add, for safety: hist_data->attrs->var_defs.name[n_vars] = NULL; Thanks, -- Steve > ret = -ENOMEM; > goto free; > }