btf_loader: Add a local 'btf' var to prep next patches

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Arnaldo Carvalho de Melo 2021-06-02 13:24:08 -03:00
parent 52bedef0fd
commit b54b74edfc
1 changed files with 5 additions and 3 deletions

View File

@ -567,10 +567,12 @@ int btf_elf__load_file(struct cus *cus, struct conf_load *conf, const char *file
if (err != 0)
goto out_free_cu;
cu->little_endian = btf__endianness(btfe->btf) == BTF_LITTLE_ENDIAN;
cu->addr_size = btf__pointer_size(btfe->btf);
struct btf *btf = btfe->btf;
err = btf__load_sections(btfe->btf, cu);
cu->little_endian = btf__endianness(btf) == BTF_LITTLE_ENDIAN;
cu->addr_size = btf__pointer_size(btf);
err = btf__load_sections(btf, cu);
if (err != 0)
goto out_free_cu;