summaryrefslogtreecommitdiffstats
path: root/tools/bpf/bpftool/struct_ops.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/bpf/bpftool/struct_ops.c')
-rw-r--r--tools/bpf/bpftool/struct_ops.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/tools/bpf/bpftool/struct_ops.c b/tools/bpf/bpftool/struct_ops.c
index d3cfdfef9b58..ae9ad85f5cda 100644
--- a/tools/bpf/bpftool/struct_ops.c
+++ b/tools/bpf/bpftool/struct_ops.c
@@ -511,10 +511,9 @@ static int do_register(int argc, char **argv)
continue;
link = bpf_map__attach_struct_ops(map);
- if (libbpf_get_error(link)) {
+ if (!link) {
p_err("can't register struct_ops %s: %s",
- bpf_map__name(map),
- strerror(-PTR_ERR(link)));
+ bpf_map__name(map), strerror(errno));
nr_errs++;
continue;
}