summaryrefslogtreecommitdiffstats
path: root/tools/lib
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2022-11-14 15:52:57 +0100
committerAndrii Nakryiko <andrii@kernel.org>2022-11-14 20:36:55 +0100
commit5fd2a60aecf3a42b14fa371c55b3dbb18b229230 (patch)
tree88b736f28c4d006a3062f4d87b2fdcd40f52ef84 /tools/lib
parentnet: dsa: make dsa_master_ioctl() see through port_hwtstamp_get() shims (diff)
downloadlinux-5fd2a60aecf3a42b14fa371c55b3dbb18b229230.tar.xz
linux-5fd2a60aecf3a42b14fa371c55b3dbb18b229230.zip
libbpf: Use correct return pointer in attach_raw_tp
We need to pass '*link' to final libbpf_get_error, because that one holds the return value, not 'link'. Fixes: 4fa5bcfe07f7 ("libbpf: Allow BPF program auto-attach handlers to bail out") Signed-off-by: Jiri Olsa <jolsa@kernel.org> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20221114145257.882322-1-jolsa@kernel.org
Diffstat (limited to 'tools/lib')
-rw-r--r--tools/lib/bpf/libbpf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
index 184ce1684dcd..91b7106a4a73 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -11169,7 +11169,7 @@ static int attach_raw_tp(const struct bpf_program *prog, long cookie, struct bpf
}
*link = bpf_program__attach_raw_tracepoint(prog, tp_name);
- return libbpf_get_error(link);
+ return libbpf_get_error(*link);
}
/* Common logic for all BPF program types that attach to a btf_id */