diff options
author | Wang Sheng-Hui <shhuiw@foxmail.com> | 2018-04-25 10:07:13 +0800 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2018-04-27 00:47:06 +0200 |
commit | c0885f61bbb6a89c35397d3a8fe49c35822cde81 (patch) | |
tree | 025e0167db35c4c5c6cd4e386aad75b85b4e7999 /include | |
parent | a6712d45b03e89800e687873fd4af015f5aaf4dd (diff) | |
download | linux-c0885f61bbb6a89c35397d3a8fe49c35822cde81.tar.bz2 |
samples, bpf: remove redundant ret assignment in bpf_load_program()
2 redundant ret assignments removed:
* 'ret = 1' before the logic 'if (data_maps)', and if any errors jump to
label 'done'. No 'ret = 1' needed before the error jump.
* After the '/* load programs */' part, if everything goes well, then
the BPF code will be loaded and 'ret' set to 0 by load_and_attach().
If something goes wrong, 'ret' set to none-O, the redundant 'ret = 0'
after the for clause will make the error skipped.
For example, if some BPF code cannot provide supported program types
in ELF SEC("unknown"), the for clause will not call load_and_attach()
to load the BPF code. 1 should be returned to callees instead of 0.
Signed-off-by: Wang Sheng-Hui <shhuiw@foxmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions