Skip to content

Commit

Permalink
tracing/osnoise: Fix missed cpus_read_unlock() in start_per_cpu_kthre…
Browse files Browse the repository at this point in the history
…ads()

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: c8895e2 ("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]>
  • Loading branch information
Zqiang1211 authored and rostedt committed Sep 8, 2021
1 parent 5615e08 commit 4b6b08f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions kernel/trace/trace_osnoise.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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
Expand Down

0 comments on commit 4b6b08f

Please sign in to comment.