path: root/kernel
diff options
authorWei Yongjun <>2017-01-12 13:55:02 +0000
committerSteven Rostedt (VMware) <>2017-02-15 09:02:27 -0500
commit8f0994bb8cbde5452e58ce0cacdbf6cb58079d01 (patch)
tree648f3881631818216a871711b9eb014551bccfb6 /kernel
parenteb583cd484f9a76c3716c0539bd06340943eeff9 (diff)
tracing: Fix return value check in trace_benchmark_reg()
In case of error, the function kthread_run() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Link: Cc: Fixes: 81dc9f0e ("tracing: Add tracepoint benchmark tracepoint") Signed-off-by: Wei Yongjun <> Signed-off-by: Steven Rostedt (VMware) <>
Diffstat (limited to 'kernel')
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/trace/trace_benchmark.c b/kernel/trace/trace_benchmark.c
index e3b4888..e49fbe9 100644
--- a/kernel/trace/trace_benchmark.c
+++ b/kernel/trace/trace_benchmark.c
@@ -175,9 +175,9 @@ int trace_benchmark_reg(void)
bm_event_thread = kthread_run(benchmark_event_kthread,
NULL, "event_benchmark");
- if (!bm_event_thread) {
+ if (IS_ERR(bm_event_thread)) {
pr_warning("trace benchmark failed to create kernel thread\n");
- return -ENOMEM;
+ return PTR_ERR(bm_event_thread);
return 0;