From: Mao Wenan <maowenan@huawei.com>
To: <ast@kernel.org>, <daniel@iogearbox.net>, <kafai@fb.com>,
<songliubraving@fb.com>, <yhs@fb.com>, <andriin@fb.com>,
<john.fastabend@gmail.com>, <kpsingh@chromium.org>
Cc: <netdev@vger.kernel.org>, <bpf@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <kernel-janitors@vger.kernel.org>
Subject: [PATCH bpf-next 2/2] libbpf: Return err if bpf_object__load failed
Date: Wed, 22 Apr 2020 16:30:10 +0800 [thread overview]
Message-ID: <20200422083010.28000-3-maowenan@huawei.com> (raw)
In-Reply-To: <20200422083010.28000-1-maowenan@huawei.com>
bpf_object__load() has various return code, when
it failed to load object, it must return err instead
of return -EINVAL.
Signed-off-by: Mao Wenan <maowenan@huawei.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
next prev parent reply other threads:[~2020-04-22 8:28 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-22 8:30 [PATCH bpf-next 0/2] Change return code if failed to load object Mao Wenan
2020-04-22 8:30 ` [PATCH bpf-next 1/2] bpf: Change error code when ops is NULL Mao Wenan
2020-04-22 9:33 ` Dan Carpenter
2020-04-24 5:10 ` kbuild test robot
2020-04-24 5:18 ` kbuild test robot
2020-04-30 2:04 ` kbuild test robot
2020-04-22 8:30 ` Mao Wenan [this message]
2020-04-22 23:27 ` [PATCH bpf-next 2/2] libbpf: Return err if bpf_object__load failed Andrii Nakryiko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200422083010.28000-3-maowenan@huawei.com \
--to=maowenan@huawei.com \
--cc=andriin@fb.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=john.fastabend@gmail.com \
--cc=kafai@fb.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=kpsingh@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=songliubraving@fb.com \
--cc=yhs@fb.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®