1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright (c) 2024 Meta Platforms, Inc. and affiliates. */
4 #include <bpf/bpf_tracing.h>
5 #include "../bpf_testmod/bpf_testmod.h"
7 char _license[] SEC("license") = "GPL";
11 /* This is a test BPF program that uses struct_ops to access an argument
12 * that may be NULL. This is a test for the verifier to ensure that it can
13 * rip PTR_MAYBE_NULL correctly.
15 SEC("struct_ops/test_maybe_null")
16 int BPF_PROG(test_maybe_null, int dummy,
17 struct task_struct *task)
25 SEC(".struct_ops.link")
26 struct bpf_testmod_ops testmod_1 = {
27 .test_maybe_null = (void *)test_maybe_null,