[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220708210335.79a38356@gandalf.local.home>
Date: Fri, 8 Jul 2022 21:03:35 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Zheng Yejian <zhengyejian1@...wei.com>
Cc: <mingo@...hat.com>, <linux-kernel@...r.kernel.org>,
<tom.zanussi@...ux.intel.com>, <trix@...hat.com>,
<stable@...r.kernel.org>, <zhangjinhao2@...wei.com>
Subject: Re: [PATCH] Revert "tracing: fix double free"
On Thu, 30 Jun 2022 09:31:37 +0800
Zheng Yejian <zhengyejian1@...wei.com> 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;
> }
Powered by blists - more mailing lists