lkml.org 
[lkml]   [2021]   [Aug]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] trace/osnoise: fix missed cpus_read_unlock()
From
Date
Hi Qiang,

On 8/29/21 7:52 AM, qiang.zhang@windriver.com wrote:
> From: "Qiang.zhang" <qiang.zhang@windriver.com>
set the Subject to:

trace/osnoise: Fix missed cpus_read_unlock() in start_per_cpu_kthreads()

>
> When start_kthread() return error, the cpus_read_unlock() need
> to be called.
>
> Signed-off-by: Qiang.zhang <qiang.zhang@windriver.com>

Add:

Fixes: c8895e271f79 ("trace/osnoise: Support hotplug operations")
Cc: <stable@vger.kernel.org> # v5.14+

> ---
> kernel/trace/trace_osnoise.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/kernel/trace/trace_osnoise.c b/kernel/trace/trace_osnoise.c
> index 65b08b8e5bf8..45d22d6f3acb 100644
> --- a/kernel/trace/trace_osnoise.c
> +++ b/kernel/trace/trace_osnoise.c
> @@ -1568,6 +1568,7 @@ static int start_per_cpu_kthreads(struct trace_array *tr)
> retval = start_kthread(cpu);
> if (retval) {
> stop_per_cpu_kthreads();
> + cpus_read_unlock();
> return retval;
> }
> }

Why not initialize retval = 0, and then remove the "return retval" from this if,
returning rteval at the end of the function?

-- Daniel

\
 
 \ /
  Last update: 2021-08-30 19:27    [W:0.056 / U:1.000 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site