[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190627210707.49ebbcf1@gandalf.local.home>
Date: Thu, 27 Jun 2019 21:07:07 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Takeshi Misawa <jeliantsurux@...il.com>
Cc: Tom Zanussi <zanussi@...nel.org>, Ingo Molnar <mingo@...hat.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] tracing: Fix memory leak in tracing_err_log_open()
On Thu, 27 Jun 2019 21:02:31 -0400
Steven Rostedt <rostedt@...dmis.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;
> > +}
> > +
Powered by blists - more mailing lists