Blob Blame History Raw
From: Andrii Nakryiko <andriin@fb.com>
Date: Fri, 4 Oct 2019 15:40:36 -0700
Subject: libbpf: fix bpf_object__name() to actually return object name
Patch-mainline: v5.5-rc1
Git-commit: c9e4c3010c8c98aa867fce386ee459a32c00a487
References: bsc#1155518

bpf_object__name() was returning file path, not name. Fix this.

Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Gary Lin <glin@suse.com>
---
 tools/lib/bpf/libbpf.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -4231,7 +4231,7 @@ bpf_object__next(struct bpf_object *prev
 
 const char *bpf_object__name(const struct bpf_object *obj)
 {
-	return obj ? obj->path : ERR_PTR(-EINVAL);
+	return obj ? obj->name : ERR_PTR(-EINVAL);
 }
 
 unsigned int bpf_object__kversion(const struct bpf_object *obj)