projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d4f7bdb
)
bpf: Use 0 instead of NOT_INIT for btf_struct_access() writes
author
Daniel Xu
<dxu@dxuuu.xyz>
Wed, 7 Sep 2022 16:40:38 +0000
(10:40 -0600)
committer
Alexei Starovoitov
<ast@kernel.org>
Sun, 11 Sep 2022 00:27:32 +0000
(17:27 -0700)
Returning a bpf_reg_type only makes sense in the context of a BPF_READ.
For writes, prefer to explicitly return 0 for clarity.
Note that is non-functional change as it just so happened that NOT_INIT
== 0.
Signed-off-by: Daniel Xu <dxu@dxuuu.xyz>
Link:
https://lore.kernel.org/r/01772bc1455ae16600796ac78c6cc9fff34f95ff.1662568410.git.dxu@dxuuu.xyz
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
net/ipv4/bpf_tcp_ca.c
patch
|
blob
|
history
diff --git
a/net/ipv4/bpf_tcp_ca.c
b/net/ipv4/bpf_tcp_ca.c
index 85a9e500c42d4f8599f6fb9e1abe4987a7d8b770..6da16ae6a96243b363889c690d76d28a3897669b 100644
(file)
--- a/
net/ipv4/bpf_tcp_ca.c
+++ b/
net/ipv4/bpf_tcp_ca.c
@@
-124,7
+124,7
@@
static int bpf_tcp_ca_btf_struct_access(struct bpf_verifier_log *log,
return -EACCES;
}
- return
NOT_INIT
;
+ return
0
;
}
BPF_CALL_2(bpf_tcp_send_ack, struct tcp_sock *, tp, u32, rcv_nxt)