提交 dcce11d5 编写于 作者: J Jules Irenge 提交者: Daniel Borkmann

bpf: Add missing annotations for __bpf_prog_enter() and __bpf_prog_exit()

Sparse reports a warning at __bpf_prog_enter() and __bpf_prog_exit()

warning: context imbalance in __bpf_prog_enter() - wrong count at exit
warning: context imbalance in __bpf_prog_exit() - unexpected unlock

The root cause is the missing annotation at __bpf_prog_enter()
and __bpf_prog_exit()

Add the missing __acquires(RCU) annotation
Add the missing __releases(RCU) annotation
Signed-off-by: NJules Irenge <jbi.octave@gmail.com>
Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20200311010908.42366-2-jbi.octave@gmail.com
上级 5996a587
...@@ -352,6 +352,7 @@ void bpf_trampoline_put(struct bpf_trampoline *tr) ...@@ -352,6 +352,7 @@ void bpf_trampoline_put(struct bpf_trampoline *tr)
* call __bpf_prog_exit * call __bpf_prog_exit
*/ */
u64 notrace __bpf_prog_enter(void) u64 notrace __bpf_prog_enter(void)
__acquires(RCU)
{ {
u64 start = 0; u64 start = 0;
...@@ -363,6 +364,7 @@ u64 notrace __bpf_prog_enter(void) ...@@ -363,6 +364,7 @@ u64 notrace __bpf_prog_enter(void)
} }
void notrace __bpf_prog_exit(struct bpf_prog *prog, u64 start) void notrace __bpf_prog_exit(struct bpf_prog *prog, u64 start)
__releases(RCU)
{ {
struct bpf_prog_stats *stats; struct bpf_prog_stats *stats;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册