Skip to content

Commit aa52660

Browse files
olsajiriacmel
authored andcommitted
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 <[email protected]> Acked-by: Song Liu <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Fixes: e4378f0 ("perf bpf: Save bpf_prog_info in a rbtree in perf_env") Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 30e4c57 commit aa52660

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tools/perf/util/env.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,11 @@ struct bpf_prog_info_node *perf_env__find_bpf_prog_info(struct perf_env *env,
5757
else if (prog_id > node->info_linear->info.id)
5858
n = n->rb_right;
5959
else
60-
break;
60+
goto out;
6161
}
62+
node = NULL;
6263

64+
out:
6365
up_read(&env->bpf_progs.lock);
6466
return node;
6567
}

0 commit comments

Comments
 (0)