Skip to content

Commit e411eb2

Browse files
Mao Wenanborkmann
authored andcommitted
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
1 parent f131bd3 commit e411eb2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/lib/bpf/libbpf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7006,7 +7006,7 @@ int bpf_prog_load_xattr(const struct bpf_prog_load_attr *attr,
70067006
err = bpf_object__load(obj);
70077007
if (err) {
70087008
bpf_object__close(obj);
7009-
return -EINVAL;
7009+
return err;
70107010
}
70117011

70127012
*pobj = obj;

0 commit comments

Comments
 (0)