Skip to content

Commit

Permalink
libbpf: Return err if bpf_object__load failed
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Mao Wenan authored and Daniel Borkmann committed Apr 27, 2020
1 parent f131bd3 commit e411eb2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/lib/bpf/libbpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e411eb2

Please sign in to comment.