lkml.org 
[lkml]   [2019]   [Apr]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] perf bpf: Fix lock/unlock imbalance in perf_env__find_btf() info
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
\
 
 \ /
  Last update: 2019-04-22 17:13    [W:0.036 / U:0.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site