Skip to content

Commit 393dc4b

Browse files
Yonghong SongAlexei Starovoitov
authored andcommitted
bpf: Remove a WARN_ON_ONCE warning related to local kptr
Currently, in function bpf_obj_free_fields(), for local kptr, a warning will be issued if the struct does not contain any special fields. But actually the kernel seems totally okay with a local kptr without any special fields. Permitting no special fields also aligns with future percpu kptr which also allows no special fields. Acked-by: Dave Marchevsky <davemarchevsky@fb.com> Signed-off-by: Yonghong Song <yonghong.song@linux.dev> Link: https://lore.kernel.org/r/20230824063417.201925-1-yonghong.song@linux.dev Signed-off-by: Alexei Starovoitov <ast@kernel.org>
1 parent f3bdb54 commit 393dc4b

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

kernel/bpf/syscall.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,6 @@ void bpf_obj_free_fields(const struct btf_record *rec, void *obj)
657657
if (!btf_is_kernel(field->kptr.btf)) {
658658
pointee_struct_meta = btf_find_struct_meta(field->kptr.btf,
659659
field->kptr.btf_id);
660-
WARN_ON_ONCE(!pointee_struct_meta);
661660
migrate_disable();
662661
__bpf_obj_drop_impl(xchgd_field, pointee_struct_meta ?
663662
pointee_struct_meta->record :

0 commit comments

Comments
 (0)