> On Apr 17, 2019, at 7:55 AM, Jiri Olsa <[email protected]> wrote:
>
> 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]>
> Cc: Alexander Shishkin <[email protected]>
> Cc: Namhyung Kim <[email protected]>
> Cc: Peter Zijlstra <[email protected]>
> Cc: Song Liu <[email protected]>
> Fixes: 3792cb2ff43b ("perf bpf: Save BTF in a rbtree in perf_env")
> Link: http://lkml.kernel.org/n/[email protected]
> Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Acked-by: Song Liu <[email protected]>
Thanks again for the fix!
> ---
> 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;
> }
>
> --
> 2.17.2
>