mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 17:30:02 +00:00
perf bpf: Return NULL when RB tree lookup fails in perf_env__find_bpf_prog_info()
We currently don't return NULL in case we don't find the
bpf_prog_info_node, fixing that.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Song Liu <songliubraving@fb.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Fixes: e4378f0cb9
("perf bpf: Save bpf_prog_info in a rbtree in perf_env")
Link: http://lkml.kernel.org/r/20190416134151.15282-1-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
30e4c57496
commit
aa52660231
1 changed files with 3 additions and 1 deletions
|
@ -57,9 +57,11 @@ struct bpf_prog_info_node *perf_env__find_bpf_prog_info(struct perf_env *env,
|
|||
else if (prog_id > node->info_linear->info.id)
|
||||
n = n->rb_right;
|
||||
else
|
||||
break;
|
||||
goto out;
|
||||
}
|
||||
node = NULL;
|
||||
|
||||
out:
|
||||
up_read(&env->bpf_progs.lock);
|
||||
return node;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue