diff options
author | Mao Wenan <maowenan@huawei.com> | 2020-04-26 14:36:35 +0800 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2020-04-27 14:43:20 +0200 |
commit | e411eb257b331bf44cbe8845b5351260c8222c6c (patch) | |
tree | 170b90071dc2c6fa576a1586698d4cbee4da60ee /tools/lib/bpf/libbpf.c | |
parent | f131bd3eee9745cc77701296e8bb7ca2b8d3345b (diff) | |
download | linux-stable-e411eb257b331bf44cbe8845b5351260c8222c6c.tar.gz linux-stable-e411eb257b331bf44cbe8845b5351260c8222c6c.tar.bz2 linux-stable-e411eb257b331bf44cbe8845b5351260c8222c6c.zip |
libbpf: Return err if bpf_object__load failed
bpf_object__load() has various return code, when it failed to load
object, it must return err instead of -EINVAL.
Signed-off-by: Mao Wenan <maowenan@huawei.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/20200426063635.130680-3-maowenan@huawei.com
Diffstat (limited to 'tools/lib/bpf/libbpf.c')
-rw-r--r-- | tools/lib/bpf/libbpf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c index 8f480e29a6b0..8e1dc6980fac 100644 --- a/tools/lib/bpf/libbpf.c +++ b/tools/lib/bpf/libbpf.c @@ -7006,7 +7006,7 @@ int bpf_prog_load_xattr(const struct bpf_prog_load_attr *attr, err = bpf_object__load(obj); if (err) { bpf_object__close(obj); - return -EINVAL; + return err; } *pobj = obj; |