On Thu, 31 Jul 2025 23:52:45 +0200
Jiri Olsa <[email protected]> wrote:
> > +int btf_find_offset(char *arg, long *offset_p)
> > +{
> > + const struct btf_type *t;
> > + struct btf *btf;
> > + long offset = 0;
> > + char *ptr;
> > + int ret;
> > + s32 id;
> > +
> > + ptr = strchr(arg, '.');
> > + if (!ptr)
> > + return -EINVAL;
> > +
> > + *ptr = '\0';
> > +
> > + id = bpf_find_btf_id(arg, BTF_KIND_STRUCT, &btf);
>
> hi,
> I think you need to call btf_put(btf) before return
I think you're correct ;-)
-- Steve