mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Masami Hiramatsu <mhiramat@kernel.org>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: rostedt@goodmis.org, mingo@redhat.com, zanussi@kernel.org,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] tracing/dynevent: Fix a memory leak in an error handling path
Date: Mon, 12 Apr 2021 17:56:11 +0900	[thread overview]
Message-ID: <20210412175611.86cd00c819ad8344502d8d95@kernel.org> (raw)
In-Reply-To: <21e3594ccd7fc88c5c162c98450409190f304327.1618136448.git.christophe.jaillet@wanadoo.fr>

On Sun, 11 Apr 2021 12:21:54 +0200
Christophe JAILLET <christophe.jaillet@wanadoo.fr> wrote:

> We must free 'argv' before returning, as already done in all the other
> paths of this function.

OOps, thanks for finding the bug!

> 
> Fixes: d262271d0483 ("tracing/dynevent: Delegate parsing to create function")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

Acked-by: Masami Hiramatsu <mhiramat@kernel.org>

Thank you,

> ---
>  kernel/trace/trace_dynevent.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/trace/trace_dynevent.c b/kernel/trace/trace_dynevent.c
> index dc971a68dda4..e57cc0870892 100644
> --- a/kernel/trace/trace_dynevent.c
> +++ b/kernel/trace/trace_dynevent.c
> @@ -63,8 +63,10 @@ int dyn_event_release(const char *raw_command, struct dyn_event_operations *type
>  		event = p + 1;
>  		*p = '\0';
>  	}
> -	if (event[0] == '\0')
> -		return -EINVAL;
> +	if (event[0] == '\0') {
> +		ret = -EINVAL;
> +		goto out;
> +	}
>  
>  	mutex_lock(&event_mutex);
>  	for_each_dyn_event_safe(pos, n) {
> -- 
> 2.27.0
> 


-- 
Masami Hiramatsu <mhiramat@kernel.org>

      reply	other threads:[~2021-04-12  9:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-11 10:21 Christophe JAILLET
2021-04-12  8:56 ` Masami Hiramatsu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210412175611.86cd00c819ad8344502d8d95@kernel.org \
    --to=mhiramat@kernel.org \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=zanussi@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®