summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorQiang.Zhang <[email protected]>2021-08-31 10:29:19 +0800
committerSteven Rostedt (VMware) <[email protected]>2021-09-08 15:10:24 -0400
commit4b6b08f2e45edda4c067ac40833e3c1f84383c0b (patch)
tree19ca18c28d01323c20c824407637c178cf6c3ae1 /kernel
parent5615e088b43d564aec08ccfaecb21ba484a1b4d6 (diff)
tracing/osnoise: Fix missed cpus_read_unlock() in start_per_cpu_kthreads()
When start_kthread() return error, the cpus_read_unlock() need to be called. Link: https://lkml.kernel.org/r/[email protected] Cc: <[email protected]> Fixes: c8895e271f79 ("trace/osnoise: Support hotplug operations") Acked-by: Daniel Bristot de Oliveira <[email protected]> Signed-off-by: Qiang.Zhang <[email protected]> Signed-off-by: Steven Rostedt (VMware) <[email protected]>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/trace/trace_osnoise.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/trace/trace_osnoise.c b/kernel/trace/trace_osnoise.c
index 65b08b8e5bf8..ce053619f289 100644
--- a/kernel/trace/trace_osnoise.c
+++ b/kernel/trace/trace_osnoise.c
@@ -1548,7 +1548,7 @@ static int start_kthread(unsigned int cpu)
static int start_per_cpu_kthreads(struct trace_array *tr)
{
struct cpumask *current_mask = &save_cpumask;
- int retval;
+ int retval = 0;
int cpu;
cpus_read_lock();
@@ -1568,13 +1568,13 @@ static int start_per_cpu_kthreads(struct trace_array *tr)
retval = start_kthread(cpu);
if (retval) {
stop_per_cpu_kthreads();
- return retval;
+ break;
}
}
cpus_read_unlock();
- return 0;
+ return retval;
}
#ifdef CONFIG_HOTPLUG_CPU