Commit b761fe22 authored by Shaohua Li's avatar Shaohua Li Committed by David S. Miller

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: default avatarShaohua Li <shli@fb.com>
Acked-by: default avatarAlexei Starovoitov <ast@kernel.org>
Acked-by: default avatarTejun Heo <tj@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e96e0ede
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment