Skip to content
Commit bee109b7 authored by Maxim Mikityanskiy's avatar Maxim Mikityanskiy Committed by Andrii Nakryiko
Browse files

bpf: Fix error message on kfunc arg type mismatch



When "arg#%d expected pointer to ctx, but got %s" error is printed, both
template parts actually point to the type of the argument, therefore, it
will also say "but got PTR", regardless of what was the actual register
type.

Fix the message to print the register type in the second part of the
template, change the existing test to adapt to the new format, and add a
new test to test the case when arg is a pointer to context, but reg is a
scalar.

Fixes: 00b85860 ("bpf: Rewrite kfunc argument handling")
Signed-off-by: default avatarMaxim Mikityanskiy <maxim@isovalent.com>
Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
Acked-by: default avatarKumar Kartikeya Dwivedi <memxor@gmail.com>
Link: https://lore.kernel.org/bpf/20240909133909.1315460-1-maxim@isovalent.com
parent f028d771
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment