Skip to content

Commit

Permalink
selftests/bpf: properly return error from bpf_flow_load
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Stanislav Fomichev authored and Daniel Borkmann committed Apr 23, 2019
1 parent 0905bee commit fe993c6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tools/testing/selftests/bpf/flow_dissector_load.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit fe993c6

Please sign in to comment.