Skip to content

Commit

Permalink
bpf: clean up put_cpu_var usage
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Shaohua Li authored and David S. Miller committed Sep 28, 2016
1 parent e96e0ed commit b761fe2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/bpf/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit b761fe2

Please sign in to comment.