mirror of https://gitee.com/openkylin/linux.git
bpf: clean up put_cpu_var usage
put_cpu_var takes the percpu data, not the data returned from get_cpu_var. This doesn't change the behavior. Cc: Tejun Heo <tj@kernel.org> Cc: Alexei Starovoitov <ast@kernel.org> Signed-off-by: Shaohua Li <shli@fb.com> Acked-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
e96e0eded1
commit
b761fe226b
|
@ -1031,7 +1031,7 @@ BPF_CALL_0(bpf_user_rnd_u32)
|
|||
|
||||
state = &get_cpu_var(bpf_user_rnd_state);
|
||||
res = prandom_u32_state(state);
|
||||
put_cpu_var(state);
|
||||
put_cpu_var(bpf_user_rnd_state);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue