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

lib: 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>
Signed-off-by: default avatarShaohua Li <shli@fb.com>
Acked-by: default avatarTejun Heo <tj@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b761fe22
......@@ -81,7 +81,7 @@ u32 prandom_u32(void)
u32 res;
res = prandom_u32_state(state);
put_cpu_var(state);
put_cpu_var(net_rand_state);
return res;
}
......@@ -128,7 +128,7 @@ void prandom_bytes(void *buf, size_t bytes)
struct rnd_state *state = &get_cpu_var(net_rand_state);
prandom_bytes_state(state, buf, bytes);
put_cpu_var(state);
put_cpu_var(net_rand_state);
}
EXPORT_SYMBOL(prandom_bytes);
......
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