Skip to content

Commit 9327035

Browse files
qmonnetborkmann
authored andcommitted
bpftool: Do not check return value from libbpf_set_strict_mode()
The function always returns 0, so we don't need to check whether the return value is 0 or not. This change was first introduced in commit a777e18 ("bpftool: Use libbpf 1.0 API mode instead of RLIMIT_MEMLOCK"), but later reverted to restore the unconditional rlimit bump in bpftool. Let's re-add it. Co-developed-by: Yafang Shao <[email protected]> Signed-off-by: Quentin Monnet <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent 6b4384f commit 9327035

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

tools/bpf/bpftool/main.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -507,9 +507,7 @@ int main(int argc, char **argv)
507507
* It will still be rejected if users use LIBBPF_STRICT_ALL
508508
* mode for loading generated skeleton.
509509
*/
510-
ret = libbpf_set_strict_mode(LIBBPF_STRICT_ALL & ~LIBBPF_STRICT_MAP_DEFINITIONS);
511-
if (ret)
512-
p_err("failed to enable libbpf strict mode: %d", ret);
510+
libbpf_set_strict_mode(LIBBPF_STRICT_ALL & ~LIBBPF_STRICT_MAP_DEFINITIONS);
513511
}
514512

515513
argc -= optind;

0 commit comments

Comments
 (0)