KFunc hid_bpf_release_context
Release the previously allocated context @ctx
Definition
ctx
: the HID-BPF context to release
void hid_bpf_release_context(struct hid_bpf_ctx *ctx)
Note
This kfunc releases the pointer passed in to it. There can be only one referenced pointer that can be passed in. All copies of the pointer being released are invalidated as a result of invoking this kfunc.
Note
This function may sleep, and therefore can only be used from sleepable programs.
This is only true when not used from BPF_PROG_TYPE_SYSCALL
programs.
Usage
Docs could be improved
This part of the docs is incomplete, contributions are very welcome
Program types
The following program types can make use of this kfunc:
BPF_PROG_TYPE_LSM
Until v6.11BPF_PROG_TYPE_TRACING
Until v6.11BPF_PROG_TYPE_STRUCT_OPS
Since v6.11BPF_PROG_TYPE_SYSCALL
Example
See hid_bpf_allocate_context for an example of how to use this kfunc.