lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 26 Apr 2020 14:36:35 +0800
From:   Mao Wenan <maowenan@...wei.com>
To:     <ast@...nel.org>, <daniel@...earbox.net>, <kafai@...com>,
        <songliubraving@...com>, <yhs@...com>, <andriin@...com>,
        <john.fastabend@...il.com>, <kpsingh@...omium.org>,
        <andrii.nakryiko@...il.com>, <dan.carpenter@...cle.com>
CC:     <netdev@...r.kernel.org>, <bpf@...r.kernel.org>,
        <kernel-janitors@...r.kernel.org>
Subject: [PATCH bpf-next v3 2/2] 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@...wei.com>
Acked-by: Andrii Nakryiko <andriin@...com>
Signed-off-by: Mao Wenan <maowenan@...wei.com>
---
 tools/lib/bpf/libbpf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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;
-- 
2.20.1

Powered by blists - more mailing lists