summaryrefslogtreecommitdiffstats
path: root/kernel/bpf/btf.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/bpf/btf.c')
-rw-r--r--kernel/bpf/btf.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c
index b7c1660fb594..805c43b083e9 100644
--- a/kernel/bpf/btf.c
+++ b/kernel/bpf/btf.c
@@ -3643,7 +3643,7 @@ struct btf *btf_parse_vmlinux(void)
goto errout;
}
- bpf_struct_ops_init(btf);
+ bpf_struct_ops_init(btf, log);
btf_verifier_env_free(env);
refcount_set(&btf->refcnt, 1);
@@ -3931,6 +3931,7 @@ again:
if (btf_type_is_ptr(mtype)) {
const struct btf_type *stype;
+ u32 id;
if (msize != size || off != moff) {
bpf_log(log,
@@ -3939,12 +3940,9 @@ again:
return -EACCES;
}
- stype = btf_type_by_id(btf_vmlinux, mtype->type);
- /* skip modifiers */
- while (btf_type_is_modifier(stype))
- stype = btf_type_by_id(btf_vmlinux, stype->type);
+ stype = btf_type_skip_modifiers(btf_vmlinux, mtype->type, &id);
if (btf_type_is_struct(stype)) {
- *next_btf_id = mtype->type;
+ *next_btf_id = id;
return PTR_TO_BTF_ID;
}
}