summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorMartin KaFai Lau <martin.lau@kernel.org>2024-03-15 22:21:12 +0300
committerAndrii Nakryiko <andrii@kernel.org>2024-03-18 22:48:10 +0300
commit7f3edd0c72c3f7214f8f28495f2e6466348eb128 (patch)
treea53d58eb46894feba698e54bbb36eb1a5371512f /kernel
parent4c8644f86c854c214aaabbcc24a27fa4c7e6a951 (diff)
downloadlinux-7f3edd0c72c3f7214f8f28495f2e6466348eb128.tar.xz
bpf: Remove unnecessary err < 0 check in bpf_struct_ops_map_update_elem
There is a "if (err)" check earlier, so the "if (err < 0)" check that this patch removing is unnecessary. It was my overlook when making adjustments to the bpf_struct_ops_prepare_trampoline() such that the caller does not have to worry about the new page when the function returns error. Fixes: 187e2af05abe ("bpf: struct_ops supports more than one page for trampolines.") Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Acked-by: Stanislav Fomichev <sdf@google.com> Link: https://lore.kernel.org/bpf/20240315192112.2825039-1-martin.lau@linux.dev
Diffstat (limited to 'kernel')
-rw-r--r--kernel/bpf/bpf_struct_ops.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/kernel/bpf/bpf_struct_ops.c b/kernel/bpf/bpf_struct_ops.c
index 43356faaa057..3fcd35314ce5 100644
--- a/kernel/bpf/bpf_struct_ops.c
+++ b/kernel/bpf/bpf_struct_ops.c
@@ -728,8 +728,6 @@ static long bpf_struct_ops_map_update_elem(struct bpf_map *map, void *key,
cur_image = image;
trampoline_start = 0;
}
- if (err < 0)
- goto reset_unlock;
*(void **)(kdata + moff) = image + trampoline_start + cfi_get_offset();