mirror of
https://github.com/torvalds/linux.git
synced 2026-11-24 23:47:06 +00:00
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 <[email protected]>
Reported-by: Song Liu <[email protected]>
Acked-by: Song Liu <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Fixes: 3792cb2ff4 ("perf bpf: Save BTF in a rbtree in perf_env")
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
This commit is contained in:
committed by
Arnaldo Carvalho de Melo
parent
b9abbdfa88
commit
2db7b1e0bd
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user