* [PATCH] perf bpf: Fix lock/unlock imbalance in perf_env__find_btf() info
@ 2019-04-22 15:10 Gustavo A. R. Silva
2019-04-22 16:05 ` Arnaldo Carvalho de Melo
0 siblings, 1 reply; 3+ messages in thread
From: Gustavo A. R. Silva @ 2019-04-22 15:10 UTC (permalink / raw)
To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
Alexander Shishkin, Jiri Olsa, Namhyung Kim
Cc: linux-kernel, Gustavo A. R. Silva
Fix lock/unlock imbalance by moving the call to up_read() just after
the *out* label.
Addresses-Coverity-ID: 1444762 ("Missing unlock")
Fixes: 2db7b1e0bd49 ("perf bpf: Return NULL when RB tree lookup fails in perf_env__find_btf()")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
tools/perf/util/env.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/util/env.c b/tools/perf/util/env.c
index 9494f9dc61ec..6a3eaf7d9353 100644
--- a/tools/perf/util/env.c
+++ b/tools/perf/util/env.c
@@ -115,8 +115,8 @@ struct btf_node *perf_env__find_btf(struct perf_env *env, __u32 btf_id)
}
node = NULL;
- up_read(&env->bpf_progs.lock);
out:
+ up_read(&env->bpf_progs.lock);
return node;
}
--
2.21.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] perf bpf: Fix lock/unlock imbalance in perf_env__find_btf() info
2019-04-22 15:10 [PATCH] perf bpf: Fix lock/unlock imbalance in perf_env__find_btf() info Gustavo A. R. Silva
@ 2019-04-22 16:05 ` Arnaldo Carvalho de Melo
2019-04-22 16:07 ` Gustavo A. R. Silva
0 siblings, 1 reply; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2019-04-22 16:05 UTC (permalink / raw)
To: Gustavo A. R. Silva
Cc: Peter Zijlstra, Ingo Molnar, Alexander Shishkin, Jiri Olsa,
Namhyung Kim, linux-kernel
Em Mon, Apr 22, 2019 at 10:10:56AM -0500, Gustavo A. R. Silva escreveu:
> Fix lock/unlock imbalance by moving the call to up_read() just after
> the *out* label.
>
> Addresses-Coverity-ID: 1444762 ("Missing unlock")
> Fixes: 2db7b1e0bd49 ("perf bpf: Return NULL when RB tree lookup fails in perf_env__find_btf()")
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> ---
> tools/perf/util/env.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/perf/util/env.c b/tools/perf/util/env.c
> index 9494f9dc61ec..6a3eaf7d9353 100644
> --- a/tools/perf/util/env.c
> +++ b/tools/perf/util/env.c
> @@ -115,8 +115,8 @@ struct btf_node *perf_env__find_btf(struct perf_env *env, __u32 btf_id)
> }
> node = NULL;
>
> - up_read(&env->bpf_progs.lock);
> out:
> + up_read(&env->bpf_progs.lock);
> return node;
> }
too late, this was fixed already, also detected by coverity :-)
- Arnaldo
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] perf bpf: Fix lock/unlock imbalance in perf_env__find_btf() info
2019-04-22 16:05 ` Arnaldo Carvalho de Melo
@ 2019-04-22 16:07 ` Gustavo A. R. Silva
0 siblings, 0 replies; 3+ messages in thread
From: Gustavo A. R. Silva @ 2019-04-22 16:07 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: Peter Zijlstra, Ingo Molnar, Alexander Shishkin, Jiri Olsa,
Namhyung Kim, linux-kernel
On 4/22/19 11:05 AM, Arnaldo Carvalho de Melo wrote:
> Em Mon, Apr 22, 2019 at 10:10:56AM -0500, Gustavo A. R. Silva escreveu:
>> Fix lock/unlock imbalance by moving the call to up_read() just after
>> the *out* label.
>>
>> Addresses-Coverity-ID: 1444762 ("Missing unlock")
>> Fixes: 2db7b1e0bd49 ("perf bpf: Return NULL when RB tree lookup fails in perf_env__find_btf()")
>> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
>> ---
>> tools/perf/util/env.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/tools/perf/util/env.c b/tools/perf/util/env.c
>> index 9494f9dc61ec..6a3eaf7d9353 100644
>> --- a/tools/perf/util/env.c
>> +++ b/tools/perf/util/env.c
>> @@ -115,8 +115,8 @@ struct btf_node *perf_env__find_btf(struct perf_env *env, __u32 btf_id)
>> }
>> node = NULL;
>>
>> - up_read(&env->bpf_progs.lock);
>> out:
>> + up_read(&env->bpf_progs.lock);
>> return node;
>> }
>
> too late, this was fixed already, also detected by coverity :-)
>
Good to know it's fixed now. :)
Thanks
--
Gustavo
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-04-22 16:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-22 15:10 [PATCH] perf bpf: Fix lock/unlock imbalance in perf_env__find_btf() info Gustavo A. R. Silva
2019-04-22 16:05 ` Arnaldo Carvalho de Melo
2019-04-22 16:07 ` Gustavo A. R. Silva
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.