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 <kiryus...@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 via email to