Skip to content

Commit 3796c3c

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

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/random32.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ u32 prandom_u32(void)
8181
u32 res;
8282

8383
res = prandom_u32_state(state);
84-
put_cpu_var(state);
84+
put_cpu_var(net_rand_state);
8585

8686
return res;
8787
}
@@ -128,7 +128,7 @@ void prandom_bytes(void *buf, size_t bytes)
128128
struct rnd_state *state = &get_cpu_var(net_rand_state);
129129

130130
prandom_bytes_state(state, buf, bytes);
131-
put_cpu_var(state);
131+
put_cpu_var(net_rand_state);
132132
}
133133
EXPORT_SYMBOL(prandom_bytes);
134134

0 commit comments

Comments
 (0)