summaryrefslogtreecommitdiff
path: root/tools/testing/selftests
diff options
context:
space:
mode:
authorStanislav Fomichev <sdf@google.com>2019-04-22 08:55:51 -0700
committerDaniel Borkmann <daniel@iogearbox.net>2019-04-23 18:36:34 +0200
commitfe993c646831105f579976fec28d1842608bd551 (patch)
tree051319a8042dc92687f9241e161c3f9c5eefbd4a /tools/testing/selftests
parent0905beec9f52caf2c7065a8a88c08bc370850710 (diff)
downloadlwn-fe993c646831105f579976fec28d1842608bd551.tar.gz
lwn-fe993c646831105f579976fec28d1842608bd551.zip
selftests/bpf: properly return error from bpf_flow_load
Right now we incorrectly return 'ret' which is always zero at that point. Signed-off-by: Stanislav Fomichev <sdf@google.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'tools/testing/selftests')
-rw-r--r--tools/testing/selftests/bpf/flow_dissector_load.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/testing/selftests/bpf/flow_dissector_load.h b/tools/testing/selftests/bpf/flow_dissector_load.h
index eeb48b6fc827..daeaeb518894 100644
--- a/tools/testing/selftests/bpf/flow_dissector_load.h
+++ b/tools/testing/selftests/bpf/flow_dissector_load.h
@@ -25,19 +25,19 @@ static inline int bpf_flow_load(struct bpf_object **obj,
main_prog = bpf_object__find_program_by_title(*obj, section_name);
if (!main_prog)
- return ret;
+ return -1;
*prog_fd = bpf_program__fd(main_prog);
if (*prog_fd < 0)
- return ret;
+ return -1;
prog_array = bpf_object__find_map_by_name(*obj, map_name);
if (!prog_array)
- return ret;
+ return -1;
prog_array_fd = bpf_map__fd(prog_array);
if (prog_array_fd < 0)
- return ret;
+ return -1;
if (keys_map_name && keys_fd) {
keys = bpf_object__find_map_by_name(*obj, keys_map_name);