mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nikita Kiryushin <kiryushin@ancud.ru>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Nikita Kiryushin <kiryushin@ancud.ru>,
	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: [PATCH] tracing: remove unreachable trace_array_put
Date: Fri, 12 Jul 2024 23:12:58 +0300	[thread overview]
Message-ID: <20240712201258.99070-1-kiryushin@ancud.ru> (raw)

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.

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
-- 
2.34.1


             reply	other threads:[~2024-07-12 20:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-12 20:12 Nikita Kiryushin [this message]
2024-07-12 23:33 ` Steven Rostedt
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=20240712201258.99070-1-kiryushin@ancud.ru \
    --to=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 \
    --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®