mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 02:39:48 +00:00
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: c0a5a21c25
("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
This commit is contained in:
parent
fe736565ef
commit
1ec5ee8c8a
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue