diff options
author | Kumar Kartikeya Dwivedi <memxor@gmail.com> | 2022-05-21 16:26:20 +0300 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2022-05-24 00:16:43 +0300 |
commit | 1ec5ee8c8a5a65ea377f8bea64bf4d5b743f6f79 (patch) | |
tree | 18eefec3dab4140b090759719590bb325b45272f /kernel | |
parent | fe736565efb775620dbcf3c459c1cd80d3e868da (diff) | |
download | linux-1ec5ee8c8a5a65ea377f8bea64bf4d5b743f6f79.tar.xz |
bpf: Suppress 'passing zero to PTR_ERR' warning
Kernel Test Robot complains about passing zero to PTR_ERR for the said
line, suppress it by using PTR_ERR_OR_ZERO.
Fixes: c0a5a21c25f3 ("bpf: Allow storing referenced kptr in map")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20220521132620.1976921-1-memxor@gmail.com
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/bpf/verifier.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index 14e8c17d3d8d..45153cbc2bd6 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -5352,7 +5352,7 @@ static int process_kptr_func(struct bpf_verifier_env *env, int regno, return -EINVAL; } if (!map_value_has_kptrs(map_ptr)) { - ret = PTR_ERR(map_ptr->kptr_off_tab); + ret = PTR_ERR_OR_ZERO(map_ptr->kptr_off_tab); if (ret == -E2BIG) verbose(env, "map '%s' has more than %d kptr\n", map_ptr->name, BPF_MAP_VALUE_OFF_MAX); |