mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
To: Beau Belgrave <beaub@linux.microsoft.com>
Cc: rostedt@goodmis.org, linux-trace-devel@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] tracing/user_events: Fix call print_fmt leak
Date: Fri, 25 Nov 2022 10:10:47 +0900	[thread overview]
Message-ID: <20221125101047.6772413447785430ccbf8046@kernel.org> (raw)
In-Reply-To: <20221123183248.554-1-beaub@linux.microsoft.com>

On Wed, 23 Nov 2022 10:32:48 -0800
Beau Belgrave <beaub@linux.microsoft.com> wrote:

> If user_event_trace_register() fails within user_event_parse() the
> call's print_fmt member is not freed. Add kfree call to fix this.
> 
> Fixes: aa3b2b4c6692 ("user_events: Add print_fmt generation support for basic types")
> Signed-off-by: Beau Belgrave <beaub@linux.microsoft.com>

This looks good to me.

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

Thank you!

> ---
>  kernel/trace/trace_events_user.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/kernel/trace/trace_events_user.c b/kernel/trace/trace_events_user.c
> index ae78c2d53c8a..b46844736015 100644
> --- a/kernel/trace/trace_events_user.c
> +++ b/kernel/trace/trace_events_user.c
> @@ -1357,6 +1357,7 @@ static int user_event_parse(struct user_event_group *group, char *name,
>  put_user:
>  	user_event_destroy_fields(user);
>  	user_event_destroy_validators(user);
> +	kfree(user->call.print_fmt);
>  	kfree(user);
>  	return ret;
>  }
> -- 
> 2.25.1
> 


-- 
Masami Hiramatsu (Google) <mhiramat@kernel.org>

      reply	other threads:[~2022-11-25  1:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-23 18:32 Beau Belgrave
2022-11-25  1:10 ` 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=20221125101047.6772413447785430ccbf8046@kernel.org \
    --to=mhiramat@kernel.org \
    --cc=beaub@linux.microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=rostedt@goodmis.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®