summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHaiyue Wang <haiyue.wang@intel.com>2023-01-08 23:12:57 +0800
committerDaniel Borkmann <daniel@iogearbox.net>2023-01-10 23:09:29 +0100
commit66cf99b55e587aa4c20d5e572142dcbf80b2684d (patch)
treecb70c3ae4eb3ed13232d451e401bc1814f87ab00
parent6d0c4b11e743b84eb57898783e9adecb9083b269 (diff)
downloadlinux-stable-66cf99b55e587aa4c20d5e572142dcbf80b2684d.tar.gz
linux-stable-66cf99b55e587aa4c20d5e572142dcbf80b2684d.tar.bz2
linux-stable-66cf99b55e587aa4c20d5e572142dcbf80b2684d.zip
bpf: Remove the unnecessary insn buffer comparison
The variable 'insn' is initialized to 'insn_buf' without being changed, only some helper macros are defined, so the insn buffer comparison is unnecessary. Just remove it. This missed removal back in 2377b81de527 ("bpf: split shared bpf_tcp_sock and bpf_sock_ops implementation"). Signed-off-by: Haiyue Wang <haiyue.wang@intel.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Stanislav Fomichev <sdf@google.com> Link: https://lore.kernel.org/bpf/20230108151258.96570-1-haiyue.wang@intel.com
-rw-r--r--net/core/filter.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/net/core/filter.c b/net/core/filter.c
index ab811293ae5d..d9befa6ba04e 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -6847,9 +6847,6 @@ u32 bpf_tcp_sock_convert_ctx_access(enum bpf_access_type type,
FIELD)); \
} while (0)
- if (insn > insn_buf)
- return insn - insn_buf;
-
switch (si->off) {
case offsetof(struct bpf_tcp_sock, rtt_min):
BUILD_BUG_ON(sizeof_field(struct tcp_sock, rtt_min) !=
@@ -10147,9 +10144,6 @@ static u32 sock_ops_convert_ctx_access(enum bpf_access_type type,
SOCK_OPS_GET_FIELD(BPF_FIELD, OBJ_FIELD, OBJ); \
} while (0)
- if (insn > insn_buf)
- return insn - insn_buf;
-
switch (si->off) {
case offsetof(struct bpf_sock_ops, op):
*insn++ = BPF_LDX_MEM(BPF_FIELD_SIZEOF(struct bpf_sock_ops_kern,