diff options
| author | Alexei Starovoitov <[email protected]> | 2025-06-26 16:48:06 +0000 |
|---|---|---|
| committer | Alexei Starovoitov <[email protected]> | 2025-06-26 16:49:39 +0000 |
| commit | 886178a33a30fe685e926d84f531243982fb3c70 (patch) | |
| tree | 23d0020f98ba1015593795ca957c55e5a306bd68 /tools/lib/bpf/libbpf.c | |
| parent | Merge branch 'bpf-add-kfuncs-for-read-only-string-operations' (diff) | |
| parent | Merge tag 'net-6.16-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/net... (diff) | |
| download | kernel-886178a33a30fe685e926d84f531243982fb3c70.tar.gz kernel-886178a33a30fe685e926d84f531243982fb3c70.zip | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf after rc3
Cross-merge BPF, perf and other fixes after downstream PRs.
It restores BPF CI to green after critical fix
commit bc4394e5e79c ("perf: Fix the throttle error of some clock events")
No conflicts.
Signed-off-by: Alexei Starovoitov <[email protected]>
Diffstat (limited to 'tools/lib/bpf/libbpf.c')
| -rw-r--r-- | tools/lib/bpf/libbpf.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c index 6445165a24f2..aee36402f0a3 100644 --- a/tools/lib/bpf/libbpf.c +++ b/tools/lib/bpf/libbpf.c @@ -597,7 +597,7 @@ struct extern_desc { int sym_idx; int btf_id; int sec_btf_id; - const char *name; + char *name; char *essent_name; bool is_set; bool is_weak; @@ -4259,7 +4259,9 @@ static int bpf_object__collect_externs(struct bpf_object *obj) return ext->btf_id; } t = btf__type_by_id(obj->btf, ext->btf_id); - ext->name = btf__name_by_offset(obj->btf, t->name_off); + ext->name = strdup(btf__name_by_offset(obj->btf, t->name_off)); + if (!ext->name) + return -ENOMEM; ext->sym_idx = i; ext->is_weak = ELF64_ST_BIND(sym->st_info) == STB_WEAK; @@ -9138,8 +9140,10 @@ void bpf_object__close(struct bpf_object *obj) zfree(&obj->btf_custom_path); zfree(&obj->kconfig); - for (i = 0; i < obj->nr_extern; i++) + for (i = 0; i < obj->nr_extern; i++) { + zfree(&obj->externs[i].name); zfree(&obj->externs[i].essent_name); + } zfree(&obj->externs); obj->nr_extern = 0; |
