diff options
author | Martin KaFai Lau <kafai@fb.com> | 2020-09-25 02:03:44 +0200 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2020-09-25 22:58:01 +0200 |
commit | a968d5e277f1a640a3184561ac2c39261ba79196 (patch) | |
tree | b5828c48b421240b444bca470034ace56372c063 /ipc/compat.c | |
parent | Merge branch 'rtt-speedup.2020.09.16a' of git://git.kernel.org/pub/scm/linux/... (diff) | |
download | linux-a968d5e277f1a640a3184561ac2c39261ba79196.tar.xz linux-a968d5e277f1a640a3184561ac2c39261ba79196.zip |
bpf: Move the PTR_TO_BTF_ID check to check_reg_type()
check_reg_type() checks whether a reg can be used as an arg of a
func_proto. For PTR_TO_BTF_ID, the check is actually not
completely done until the reg->btf_id is pointing to a
kernel struct that is acceptable by the func_proto.
Thus, this patch moves the btf_id check into check_reg_type().
"arg_type" and "arg_btf_id" are passed to check_reg_type() instead of
"compatible". The compatible_reg_types[] usage is localized in
check_reg_type() now.
The "if (!btf_id) verbose(...); " is also removed since it won't happen.
Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Lorenz Bauer <lmb@cloudflare.com>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Link: https://lore.kernel.org/bpf/20200925000344.3854828-1-kafai@fb.com
Diffstat (limited to 'ipc/compat.c')
0 files changed, 0 insertions, 0 deletions