Skip to content

Commit b761fe2

Browse files
shligitdavem330
authored andcommitted
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 <[email protected]> Cc: Alexei Starovoitov <[email protected]> Signed-off-by: Shaohua Li <[email protected]> Acked-by: Alexei Starovoitov <[email protected]> Acked-by: Tejun Heo <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent e96e0ed commit b761fe2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/bpf/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1031,7 +1031,7 @@ BPF_CALL_0(bpf_user_rnd_u32)
10311031

10321032
state = &get_cpu_var(bpf_user_rnd_state);
10331033
res = prandom_u32_state(state);
1034-
put_cpu_var(state);
1034+
put_cpu_var(bpf_user_rnd_state);
10351035

10361036
return res;
10371037
}

0 commit comments

Comments
 (0)