Message ID | 20211122144742.477787-3-memxor@gmail.com (mailing list archive) |
---|---|
State | Accepted |
Commit | b12f031043247b80999bf5e03b8cded3b0b40f8d |
Delegated to: | BPF |
Headers | show |
Series | Fixes for kfunc-mod regressions and warnings | expand |
On Mon, Nov 22, 2021 at 6:47 AM Kumar Kartikeya Dwivedi <memxor@gmail.com> wrote: > > When module registering its set is built-in, THIS_MODULE will be NULL, > hence we cannot return early in case owner is NULL. > > Fixes: 14f267d95fe4 ("bpf: btf: Introduce helpers for dynamic BTF set registration") > Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com> Acked-by: Song Liu <songliubraving@fb.com>
diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c index ea3df9867cec..9bdb03767db5 100644 --- a/kernel/bpf/btf.c +++ b/kernel/bpf/btf.c @@ -6371,8 +6371,6 @@ bool bpf_check_mod_kfunc_call(struct kfunc_btf_id_list *klist, u32 kfunc_id, { struct kfunc_btf_id_set *s; - if (!owner) - return false; mutex_lock(&klist->mutex); list_for_each_entry(s, &klist->list, list) { if (s->owner == owner && btf_id_set_contains(s->set, kfunc_id)) {
When module registering its set is built-in, THIS_MODULE will be NULL, hence we cannot return early in case owner is NULL. Fixes: 14f267d95fe4 ("bpf: btf: Introduce helpers for dynamic BTF set registration") Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com> --- kernel/bpf/btf.c | 2 -- 1 file changed, 2 deletions(-)