Skip to contentSkip to conversation

random: update comment from copy_to_user() -> copy_to_iter()

PATCH New Jason A. Donenfeld 1 participant 1 message Jun 20, 2022 Random number driver

lore
Share & tools
lore

Jason A. Donenfeld

author maintainer
#0 lore raw

PATCH 1/1 random: update comment from copy_to_user() -> copy_to_iter()

This comment wasn't updated when we moved from read() to read_iter(), so this patch makes the trivial fix.

Fixes 1b388e7765f2 ("random: convert to using fops->read_iter()")
---
 drivers/char/random.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/random.c +1 -1
index 07a022e24057..e3dd1dd3dd22 100644
@@ -408,7 +408,7 @@ static ssize_t get_random_bytes_user(struct iov_iter *iter)
 
 	/*
 	 * Immediately overwrite the ChaCha key at index 4 with random
-	 * bytes, in case userspace causes copy_to_user() below to sleep
+	 * bytes, in case userspace causes copy_to_iter() below to sleep
 	 * forever, so that we still retain forward secrecy in that case.
 	 */
 	crng_make_state(chacha_state, (u8 *)&chacha_state[4], CHACHA_KEY_SIZE);
Signature · 1 line
2.35.1