Skip to content

Commit 1ec5ee8

Browse files
kkdwivediborkmann
authored andcommitted
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: c0a5a21 ("bpf: Allow storing referenced kptr in map") Reported-by: kernel test robot <[email protected]> Signed-off-by: Kumar Kartikeya Dwivedi <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent fe73656 commit 1ec5ee8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/bpf/verifier.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5352,7 +5352,7 @@ static int process_kptr_func(struct bpf_verifier_env *env, int regno,
53525352
return -EINVAL;
53535353
}
53545354
if (!map_value_has_kptrs(map_ptr)) {
5355-
ret = PTR_ERR(map_ptr->kptr_off_tab);
5355+
ret = PTR_ERR_OR_ZERO(map_ptr->kptr_off_tab);
53565356
if (ret == -E2BIG)
53575357
verbose(env, "map '%s' has more than %d kptr\n", map_ptr->name,
53585358
BPF_MAP_VALUE_OFF_MAX);

0 commit comments

Comments
 (0)