From: Steven Rostedt <rostedt@goodmis.org>
To: Nikita Kiryushin <kiryushin@ancud.ru>
Cc: Masami Hiramatsu <mhiramat@kernel.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org,
lvc-project@linuxtesting.org
Subject: Re: [PATCH] tracing: remove unreachable trace_array_put
Date: Fri, 12 Jul 2024 19:33:06 -0400 [thread overview]
Message-ID: <20240712193306.3174c85e@gandalf.local.home> (raw)
In-Reply-To: <20240712201258.99070-1-kiryushin@ancud.ru>
On Fri, 12 Jul 2024 23:12:58 +0300
Nikita Kiryushin <kiryushin@ancud.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@ancud.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
next prev parent reply other threads:[~2024-07-12 23:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-12 20:12 [PATCH] tracing: remove unreachable trace_array_put Nikita Kiryushin
2024-07-12 23:33 ` Steven Rostedt [this message]
2024-07-15 13:47 ` Nikita Kiryushin
2024-07-16 9:45 ` [lvc-project] " Alexey Khoroshilov
2024-07-16 19:19 ` Nikita Kiryushin
2024-07-16 19:34 ` Steven Rostedt
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=20240712193306.3174c85e@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=kiryushin@ancud.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=lvc-project@linuxtesting.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@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;
as well as URLs for NNTP newsgroup(s).