mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Takeshi Misawa <jeliantsurux@gmail.com>
Cc: Tom Zanussi <zanussi@kernel.org>, Ingo Molnar <mingo@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] tracing: Fix memory leak in tracing_err_log_open()
Date: Thu, 27 Jun 2019 21:07:07 -0400	[thread overview]
Message-ID: <20190627210707.49ebbcf1@gandalf.local.home> (raw)
In-Reply-To: <20190627210231.07cb24aa@gandalf.local.home>

On Thu, 27 Jun 2019 21:02:31 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:

> > +++ b/kernel/trace/trace.c
> > @@ -7126,12 +7126,24 @@ static ssize_t tracing_err_log_write(struct file *file,
> >  	return count;
> >  }
> >  
> > +static int tracing_err_log_release(struct inode *inode, struct file *file)
> > +{
> > +	struct trace_array *tr = inode->i_private;
> > +
> > +	trace_array_put(tr);
> > +
> > +	if (file->private_data)

Actually, I think it is safer to have the condition be:

	if (file->f_mode & FMODE_READ)

As that would match the open.

Takeshi,

Can you send a v2?

Thanks!

-- Steve

> > +		seq_release(inode, file);
> > +
> > +	return 0;
> > +}
> > +

      reply	other threads:[~2019-06-28  1:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-27 11:41 Takeshi Misawa
2019-06-28  1:02 ` Steven Rostedt
2019-06-28  1:07   ` Steven Rostedt [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=20190627210707.49ebbcf1@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=jeliantsurux@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --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®