Skip to content

Commit 395e942

Browse files
wangchuanguolcborkmann
authored andcommitted
bpf: Replace hard-coded 0 with BPF_K in check_alu_op
Enhance readability a bit. Signed-off-by: Simon Wang <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Acked-by: John Fastabend <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent 6dc7a0b commit 395e942

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/bpf/verifier.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9096,7 +9096,7 @@ static int check_alu_op(struct bpf_verifier_env *env, struct bpf_insn *insn)
90969096

90979097
if (opcode == BPF_END || opcode == BPF_NEG) {
90989098
if (opcode == BPF_NEG) {
9099-
if (BPF_SRC(insn->code) != 0 ||
9099+
if (BPF_SRC(insn->code) != BPF_K ||
91009100
insn->src_reg != BPF_REG_0 ||
91019101
insn->off != 0 || insn->imm != 0) {
91029102
verbose(env, "BPF_NEG uses reserved fields\n");

0 commit comments

Comments
 (0)