From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
To: Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] perf bpf: Fix lock/unlock imbalance in perf_env__find_btf() info
Date: Mon, 22 Apr 2019 11:07:30 -0500 [thread overview]
Message-ID: <6a40243b-4e6e-3e15-3faa-bd2c053efd65@embeddedor.com> (raw)
In-Reply-To: <20190422160523.GC11750@kernel.org>
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
prev parent reply other threads:[~2019-04-22 16:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6a40243b-4e6e-3e15-3faa-bd2c053efd65@embeddedor.com \
--to=gustavo@embeddedor.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=arnaldo.melo@gmail.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox