Skip to content

Commit

Permalink
bpf: Remove a WARN_ON_ONCE warning related to local kptr
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Yonghong Song <[email protected]>
  • Loading branch information
Yonghong Song authored and intel-lab-lkp committed Aug 24, 2023
1 parent f3bdb54 commit b83603e
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion kernel/bpf/syscall.c
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,6 @@ void bpf_obj_free_fields(const struct btf_record *rec, void *obj)
if (!btf_is_kernel(field->kptr.btf)) {
pointee_struct_meta = btf_find_struct_meta(field->kptr.btf,
field->kptr.btf_id);
WARN_ON_ONCE(!pointee_struct_meta);
migrate_disable();
__bpf_obj_drop_impl(xchgd_field, pointee_struct_meta ?
pointee_struct_meta->record :
Expand Down

0 comments on commit b83603e

Please sign in to comment.