[PATCH] BPF: remove useless condition check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: zhongjun <zhongjun@xxxxxxxxxxxxx>

According to contents of 'linux/bpf_types.h', array size of
bpf_verifier_ops will never be ZERO.
Removing useless check to make code more straight and optimal.

Signed-off-by: Jun Zhong <zhongjun@xxxxxxxxxxxxx>
base-commit: 738a96c4a8c36950803fdd27e7c30aca92dccefd
---
 kernel/bpf/verifier.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index d517d13878cf..21047b26dae7 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -17655,10 +17655,6 @@ int bpf_check(struct bpf_prog **prog, union bpf_attr *attr, bpfptr_t uattr)
 	int i, len, ret = -EINVAL;
 	bool is_priv;
 
-	/* no program is valid */
-	if (ARRAY_SIZE(bpf_verifier_ops) == 0)
-		return -EINVAL;
-
 	/* 'struct bpf_verifier_env' can be global, but since it's not small,
 	 * allocate/free it every time bpf_check() is called
 	 */
-- 
2.20.1




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux