[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-2db7b1e0bd49d2b0e7d16949e167b1cfaf5c07cf@git.kernel.org>
Date: Fri, 19 Apr 2019 10:20:56 -0700
From: tip-bot for Jiri Olsa <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: alexander.shishkin@...ux.intel.com, peterz@...radead.org,
linux-kernel@...r.kernel.org, hpa@...or.com, namhyung@...nel.org,
acme@...hat.com, songliubraving@...com, jolsa@...nel.org,
tglx@...utronix.de, mingo@...nel.org
Subject: [tip:perf/urgent] perf bpf: Return NULL when RB tree lookup fails
in perf_env__find_btf()
Commit-ID: 2db7b1e0bd49d2b0e7d16949e167b1cfaf5c07cf
Gitweb: https://git.kernel.org/tip/2db7b1e0bd49d2b0e7d16949e167b1cfaf5c07cf
Author: Jiri Olsa <jolsa@...nel.org>
AuthorDate: Wed, 17 Apr 2019 16:55:39 +0200
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Wed, 17 Apr 2019 14:30:23 -0300
perf bpf: Return NULL when RB tree lookup fails in perf_env__find_btf()
We don't return NULL when we don't find the bpf_prog_info_node, fix
that.
Signed-off-by: Jiri Olsa <jolsa@...nel.org>
Reported-by: Song Liu <songliubraving@...com>
Acked-by: Song Liu <songliubraving@...com>
Cc: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Fixes: 3792cb2ff43b ("perf bpf: Save BTF in a rbtree in perf_env")
Link: http://lkml.kernel.org/r/20190417145539.11669-1-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/perf/util/env.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tools/perf/util/env.c b/tools/perf/util/env.c
index 34a363f2e71b..9494f9dc61ec 100644
--- a/tools/perf/util/env.c
+++ b/tools/perf/util/env.c
@@ -111,10 +111,12 @@ struct btf_node *perf_env__find_btf(struct perf_env *env, __u32 btf_id)
else if (btf_id > node->id)
n = n->rb_right;
else
- break;
+ goto out;
}
+ node = NULL;
up_read(&env->bpf_progs.lock);
+out:
return node;
}
Powered by blists - more mailing lists