netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf bpf: return value with unlocking in perf_env__find_btf()
@ 2019-04-22  8:01 Bo YU
  2019-04-22  9:36 ` Jiri Olsa
  0 siblings, 1 reply; 3+ messages in thread
From: Bo YU @ 2019-04-22  8:01 UTC (permalink / raw)
  To: peterz, acme, alexander.shishkin, jolsa, namhyung, ast, daniel,
	kafai, songliubraving, yhs, adrian.hunter
  Cc: Bo YU, linux-kernel, netdev, bpf

In perf_env__find_btf(), returning without unlocking
"env->bpf_progs.lock". There may be cause lockdep issue.

DEtected by CoversityScan, CID# 1444762:(program hangs(LOCK))

Fixes: 2db7b1e0bd49d: (perf bpf: Return NULL when RB tree lookup fails in perf_env__find_btf())
Signed-off-by: Bo YU <tsu.yubo@gmail.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.11.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-04-22 14:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-22  8:01 [PATCH] perf bpf: return value with unlocking in perf_env__find_btf() Bo YU
2019-04-22  9:36 ` Jiri Olsa
2019-04-22 14:29   ` Arnaldo Carvalho de Melo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).