From: Kui-Feng Lee <thinker.li@xxxxxxxxx> To reuse the check_member function of the bpf_struct_ops structure for checking if an operator is supported, we permit passing a NULL value for the "prog" argument in check_member. The check_member function of the bpf_struct_ops structure will be utilized for checking cfi_stubs in a subsequent patch when registering a struct_ops type. netdev@xxxxxxxxxxxxxxx Signed-off-by: Kui-Feng Lee <thinker.li@xxxxxxxxx> --- net/bpf/bpf_dummy_struct_ops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/bpf/bpf_dummy_struct_ops.c b/net/bpf/bpf_dummy_struct_ops.c index 02de71719aed..5fe5461d3173 100644 --- a/net/bpf/bpf_dummy_struct_ops.c +++ b/net/bpf/bpf_dummy_struct_ops.c @@ -178,7 +178,7 @@ static int bpf_dummy_ops_check_member(const struct btf_type *t, case offsetof(struct bpf_dummy_ops, test_sleepable): break; default: - if (prog->aux->sleepable) + if (prog && prog->aux->sleepable) return -EINVAL; } -- 2.34.1