diff options
| author | Quentin Monnet <[email protected]> | 2021-07-29 16:20:21 +0000 |
|---|---|---|
| committer | Andrii Nakryiko <[email protected]> | 2021-07-30 00:03:41 +0000 |
| commit | 6d2d73cdd673d493f9f3751188757129b1d23fb7 (patch) | |
| tree | 69aeb245d7b61958200d0e678bdcb56136cd4c0f /tools/bpf/bpftool/prog.c | |
| parent | bpf: Emit better log message if bpf_iter ctx arg btf_id == 0 (diff) | |
| download | kernel-6d2d73cdd673d493f9f3751188757129b1d23fb7.tar.gz kernel-6d2d73cdd673d493f9f3751188757129b1d23fb7.zip | |
libbpf: Return non-null error on failures in libbpf_find_prog_btf_id()
Variable "err" is initialised to -EINVAL so that this error code is
returned when something goes wrong in libbpf_find_prog_btf_id().
However, a recent change in the function made use of the variable in
such a way that it is set to 0 if retrieving linear information on the
program is successful, and this 0 value remains if we error out on
failures at later stages.
Let's fix this by setting err to -EINVAL later in the function.
Fixes: e9fc3ce99b34 ("libbpf: Streamline error reporting for high-level APIs")
Signed-off-by: Quentin Monnet <[email protected]>
Signed-off-by: Andrii Nakryiko <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/bpf/bpftool/prog.c')
0 files changed, 0 insertions, 0 deletions
