summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPuranjay Mohan <puranjay@kernel.org>2026-01-02 21:00:31 +0300
committerAlexei Starovoitov <ast@kernel.org>2026-01-02 23:04:29 +0300
commit8fe172fa305f14db815bd88133d2030e4a9e107e (patch)
treef2c860ceb840e40e3640f23bae3c3127adf2f3aa
parentcd1d60949143b10d8eb7cea111e2b8bfb18fe461 (diff)
downloadlinux-8fe172fa305f14db815bd88133d2030e4a9e107e.tar.xz
HID: bpf: drop dead NULL checks in kfuncs
As KF_TRUSTED_ARGS is now considered default for all kfuns, the verifier will not allow passing NULL pointers to these kfuns. These checks for NULL pointers can therefore be removed. Signed-off-by: Puranjay Mohan <puranjay@kernel.org> Link: https://lore.kernel.org/r/20260102180038.2708325-6-puranjay@kernel.org Signed-off-by: Alexei Starovoitov <ast@kernel.org>
-rw-r--r--drivers/hid/bpf/hid_bpf_dispatch.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/hid/bpf/hid_bpf_dispatch.c b/drivers/hid/bpf/hid_bpf_dispatch.c
index 9a06f9b0e4ef..892aca026ffa 100644
--- a/drivers/hid/bpf/hid_bpf_dispatch.c
+++ b/drivers/hid/bpf/hid_bpf_dispatch.c
@@ -295,9 +295,6 @@ hid_bpf_get_data(struct hid_bpf_ctx *ctx, unsigned int offset, const size_t rdwr
{
struct hid_bpf_ctx_kern *ctx_kern;
- if (!ctx)
- return NULL;
-
ctx_kern = container_of(ctx, struct hid_bpf_ctx_kern, ctx);
if (rdwr_buf_size + offset > ctx->allocated_size)
@@ -364,7 +361,7 @@ __hid_bpf_hw_check_params(struct hid_bpf_ctx *ctx, __u8 *buf, size_t *buf__sz,
u32 report_len;
/* check arguments */
- if (!ctx || !hid_ops || !buf)
+ if (!hid_ops)
return -EINVAL;
switch (rtype) {