[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220727153519.6697-1-liqiong@nfschina.com>
Date: Wed, 27 Jul 2022 23:35:19 +0800
From: Li Qiong <liqiong@...china.com>
To: Steven Rostedt <rostedt@...dmis.org>,
Ingo Molnar <mingo@...hat.com>
Cc: linux-kernel@...r.kernel.org, yuzhe@...china.com,
renyu@...china.com, jiaming@...china.com,
Li Qiong <liqiong@...china.com>
Subject: [PATCH] tracing: Do PTR_ERR() after IS_ERR()
Check IS_ERR() firstly, then do PTR_ERR().
Signed-off-by: Li Qiong <liqiong@...china.com>
---
kernel/trace/ring_buffer_benchmark.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/kernel/trace/ring_buffer_benchmark.c b/kernel/trace/ring_buffer_benchmark.c
index 78e576575b79..a8f6b0725c45 100644
--- a/kernel/trace/ring_buffer_benchmark.c
+++ b/kernel/trace/ring_buffer_benchmark.c
@@ -439,17 +439,19 @@ static int __init ring_buffer_benchmark_init(void)
if (!disable_reader) {
consumer = kthread_create(ring_buffer_consumer_thread,
NULL, "rb_consumer");
- ret = PTR_ERR(consumer);
- if (IS_ERR(consumer))
+ if (IS_ERR(consumer)) {
+ ret = PTR_ERR(consumer);
goto out_fail;
+ }
}
producer = kthread_run(ring_buffer_producer_thread,
NULL, "rb_producer");
- ret = PTR_ERR(producer);
- if (IS_ERR(producer))
+ if (IS_ERR(producer)) {
+ ret = PTR_ERR(producer);
goto out_kill;
+ }
/*
* Run them as low-prio background tasks by default:
--
2.11.0
Powered by blists - more mailing lists