Commit fe993c64 authored by Stanislav Fomichev's avatar Stanislav Fomichev Committed by Daniel Borkmann

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: default avatarStanislav Fomichev <sdf@google.com>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
parent 0905beec
...@@ -25,19 +25,19 @@ static inline int bpf_flow_load(struct bpf_object **obj, ...@@ -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); main_prog = bpf_object__find_program_by_title(*obj, section_name);
if (!main_prog) if (!main_prog)
return ret; return -1;
*prog_fd = bpf_program__fd(main_prog); *prog_fd = bpf_program__fd(main_prog);
if (*prog_fd < 0) if (*prog_fd < 0)
return ret; return -1;
prog_array = bpf_object__find_map_by_name(*obj, map_name); prog_array = bpf_object__find_map_by_name(*obj, map_name);
if (!prog_array) if (!prog_array)
return ret; return -1;
prog_array_fd = bpf_map__fd(prog_array); prog_array_fd = bpf_map__fd(prog_array);
if (prog_array_fd < 0) if (prog_array_fd < 0)
return ret; return -1;
if (keys_map_name && keys_fd) { if (keys_map_name && keys_fd) {
keys = bpf_object__find_map_by_name(*obj, keys_map_name); keys = bpf_object__find_map_by_name(*obj, keys_map_name);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment