[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240712201258.99070-1-kiryushin@ancud.ru>
Date: Fri, 12 Jul 2024 23:12:58 +0300
From: Nikita Kiryushin <kiryushin@...ud.ru>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: Nikita Kiryushin <kiryushin@...ud.ru>,
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: [PATCH] tracing: remove unreachable trace_array_put
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@...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
--
2.34.1
Powered by blists - more mailing lists