linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tracing: remove unreachable trace_array_put
@ 2024-07-12 20:12 Nikita Kiryushin
  2024-07-12 23:33 ` Steven Rostedt
  0 siblings, 1 reply; 6+ messages in thread
From: Nikita Kiryushin @ 2024-07-12 20:12 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Nikita Kiryushin, Masami Hiramatsu, Mathieu Desnoyers,
	linux-kernel, linux-trace-kernel, lvc-project

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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-07-16 19:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-12 20:12 [PATCH] tracing: remove unreachable trace_array_put Nikita Kiryushin
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

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).