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
This commit is contained in:

committed by
Daniel Borkmann

parent
f131bd3eee
commit
e411eb257b
@@ -7006,7 +7006,7 @@ int bpf_prog_load_xattr(const struct bpf_prog_load_attr *attr,
|
|||||||
err = bpf_object__load(obj);
|
err = bpf_object__load(obj);
|
||||||
if (err) {
|
if (err) {
|
||||||
bpf_object__close(obj);
|
bpf_object__close(obj);
|
||||||
return -EINVAL;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
*pobj = obj;
|
*pobj = obj;
|
||||||
|
Reference in New Issue
Block a user