Commit 4b6b08f2 authored by Qiang.Zhang's avatar Qiang.Zhang Committed by Steven Rostedt (VMware)

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/20210831022919.27630-1-qiang.zhang@windriver.com

Cc: <stable@vger.kernel.org>
Fixes: c8895e27 ("trace/osnoise: Support hotplug operations")
Acked-by: default avatarDaniel Bristot de Oliveira <bristot@kernel.org>
Signed-off-by: default avatarQiang.Zhang <qiang.zhang@windriver.com>
Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
parent 5615e088
...@@ -1548,7 +1548,7 @@ static int start_kthread(unsigned int cpu) ...@@ -1548,7 +1548,7 @@ static int start_kthread(unsigned int cpu)
static int start_per_cpu_kthreads(struct trace_array *tr) static int start_per_cpu_kthreads(struct trace_array *tr)
{ {
struct cpumask *current_mask = &save_cpumask; struct cpumask *current_mask = &save_cpumask;
int retval; int retval = 0;
int cpu; int cpu;
cpus_read_lock(); cpus_read_lock();
...@@ -1568,13 +1568,13 @@ static int start_per_cpu_kthreads(struct trace_array *tr) ...@@ -1568,13 +1568,13 @@ static int start_per_cpu_kthreads(struct trace_array *tr)
retval = start_kthread(cpu); retval = start_kthread(cpu);
if (retval) { if (retval) {
stop_per_cpu_kthreads(); stop_per_cpu_kthreads();
return retval; break;
} }
} }
cpus_read_unlock(); cpus_read_unlock();
return 0; return retval;
} }
#ifdef CONFIG_HOTPLUG_CPU #ifdef CONFIG_HOTPLUG_CPU
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment