Skip to content

Commit

Permalink
lib: 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>
Signed-off-by: Shaohua Li <shli@fb.com>
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 b761fe2 commit 3796c3c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/random32.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 3796c3c

Please sign in to comment.