summaryrefslogtreecommitdiff
path: root/net/bpf
diff options
context:
space:
mode:
authorDaniel Xu <dxu@dxuuu.xyz>2022-05-29 23:15:41 +0300
committerAndrii Nakryiko <andrii@kernel.org>2022-06-04 00:53:33 +0300
commit988d0d5899248b758d2f2eae3b57708fe78a8618 (patch)
tree2cbc6fb9418bf13e78f3b41f97f847fdf4f7f740 /net/bpf
parent9bbdfad8a5192cfa698994dd8db3a52b137e7478 (diff)
downloadlinux-988d0d5899248b758d2f2eae3b57708fe78a8618.tar.xz
bpf, test_run: Remove unnecessary prog type checks
These checks were effectively noops b/c there's only one way these functions get called: through prog_ops dispatching. And since there's no other callers, we can be sure that `prog` is always the correct type. Signed-off-by: Daniel Xu <dxu@dxuuu.xyz> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Acked-by: Song Liu <songliubraving@fb.com> Link: https://lore.kernel.org/bpf/0a9aaac329f76ddb17df1786b001117823ffefa5.1653855302.git.dxu@dxuuu.xyz
Diffstat (limited to 'net/bpf')
-rw-r--r--net/bpf/test_run.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/net/bpf/test_run.c b/net/bpf/test_run.c
index 56f059b3c242..2ca96acbc50a 100644
--- a/net/bpf/test_run.c
+++ b/net/bpf/test_run.c
@@ -1420,9 +1420,6 @@ int bpf_prog_test_run_flow_dissector(struct bpf_prog *prog,
void *data;
int ret;
- if (prog->type != BPF_PROG_TYPE_FLOW_DISSECTOR)
- return -EINVAL;
-
if (kattr->test.flags || kattr->test.cpu || kattr->test.batch_size)
return -EINVAL;
@@ -1487,9 +1484,6 @@ int bpf_prog_test_run_sk_lookup(struct bpf_prog *prog, const union bpf_attr *kat
u32 retval, duration;
int ret = -EINVAL;
- if (prog->type != BPF_PROG_TYPE_SK_LOOKUP)
- return -EINVAL;
-
if (kattr->test.flags || kattr->test.cpu || kattr->test.batch_size)
return -EINVAL;