[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240712193306.3174c85e@gandalf.local.home>
Date: Fri, 12 Jul 2024 19:33:06 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Nikita Kiryushin <kiryushin@...ud.ru>
Cc: Masami Hiramatsu <mhiramat@...nel.org>, Mathieu Desnoyers
<mathieu.desnoyers@...icios.com>, linux-kernel@...r.kernel.org,
linux-trace-kernel@...r.kernel.org, lvc-project@...uxtesting.org
Subject: Re: [PATCH] tracing: remove unreachable trace_array_put
On Fri, 12 Jul 2024 23:12:58 +0300
Nikita Kiryushin <kiryushin@...ud.ru> wrote:
> There is a trace_array_put() in check result for
> nonseekable_open() in tracing_buffers_open(). However,
> it would be never executed as nonseekable_open never fails
> (by design).
>
> Remove the check and associated unreachable code.
Then why does it return a value?
If someday it can return a failure, this would then cause a leak. It
doesn't hurt to leave it in.
So NACK.
-- Steve
>
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
>
> Fixes: 7b85af630348 ("tracing: Get trace_array ref counts when accessing trace files")
> Signed-off-by: Nikita Kiryushin <kiryushin@...ud.ru>
> ---
> kernel/trace/trace.c | 6 +-----
> 1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
> index 578a49ff5c32..7e480501b509 100644
> --- a/kernel/trace/trace.c
> +++ b/kernel/trace/trace.c
> @@ -7883,11 +7883,7 @@ static int tracing_buffers_open(struct inode *inode, struct file *filp)
>
> mutex_unlock(&trace_types_lock);
>
> - ret = nonseekable_open(inode, filp);
> - if (ret < 0)
> - trace_array_put(tr);
> -
> - return ret;
> + return nonseekable_open(inode, filp);
> }
>
> static __poll_t
Powered by blists - more mailing lists