diff options
author | David Vernet <void@manifault.com> | 2023-03-25 22:31:45 +0100 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2023-03-26 00:56:22 +0100 |
commit | fb2211a57c110b4ced3cb7f8570bd7246acf2d04 (patch) | |
tree | 1d94a550acc6b2ee4a15129002a1a3bbbbea80b3 /kernel/bpf/helpers.c | |
parent | bpf: Only invoke kptr dtor following non-NULL xchg (diff) | |
download | linux-fb2211a57c110b4ced3cb7f8570bd7246acf2d04.tar.xz linux-fb2211a57c110b4ced3cb7f8570bd7246acf2d04.zip |
bpf: Remove now-unnecessary NULL checks for KF_RELEASE kfuncs
Now that we're not invoking kfunc destructors when the kptr in a map was
NULL, we no longer require NULL checks in many of our KF_RELEASE kfuncs.
This patch removes those NULL checks.
Signed-off-by: David Vernet <void@manifault.com>
Link: https://lore.kernel.org/r/20230325213144.486885-3-void@manifault.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'kernel/bpf/helpers.c')
-rw-r--r-- | kernel/bpf/helpers.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c index f753676ef652..8980f6859443 100644 --- a/kernel/bpf/helpers.c +++ b/kernel/bpf/helpers.c @@ -2089,9 +2089,6 @@ __bpf_kfunc struct task_struct *bpf_task_kptr_get(struct task_struct **pp) */ __bpf_kfunc void bpf_task_release(struct task_struct *p) { - if (!p) - return; - put_task_struct(p); } @@ -2148,9 +2145,6 @@ __bpf_kfunc struct cgroup *bpf_cgroup_kptr_get(struct cgroup **cgrpp) */ __bpf_kfunc void bpf_cgroup_release(struct cgroup *cgrp) { - if (!cgrp) - return; - cgroup_put(cgrp); } |