summary refs log tree commit diff
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-04-04 14:31:53 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2018-04-04 14:31:53 -0700
commit0c21fd6e659342d6b6bb4b4c9ddc0f1c38b5216e (patch)
tree3f993ae0ff904c55b8ec8b0d44f2d4a4b4c3857e /include
parent3e968c9f1401088abc9a19ae6ff571644d37a355 (diff)
parent5e747dd9be54be190dd6ebeebf4a4a01ba765625 (diff)
downloadlinux-0c21fd6e659342d6b6bb4b4c9ddc0f1c38b5216e.tar.gz
Merge tag 'random_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/random
Pull /dev/random updates from Ted Ts'o:
 "A few random (cough, cough) cleanups for the /dev/random driver"

* tag 'random_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/random:
  drivers/char/random.c: remove unused dont_count_entropy
  random: optimize add_interrupt_randomness
  random: always fill buffer in get_random_bytes_wait
  random: use a tighter cap in credit_entropy_bits_safe()
Diffstat (limited to 'include')
-rw-r--r--include/linux/random.h4
1 files changed, 1 insertions, 3 deletions
diff --git a/include/linux/random.h b/include/linux/random.h
index 4024f7d9c77d..2ddf13b4281e 100644
--- a/include/linux/random.h
+++ b/include/linux/random.h
@@ -85,10 +85,8 @@ static inline unsigned long get_random_canary(void)
 static inline int get_random_bytes_wait(void *buf, int nbytes)
 {
 	int ret = wait_for_random_bytes();
-	if (unlikely(ret))
-		return ret;
 	get_random_bytes(buf, nbytes);
-	return 0;
+	return ret;
 }
 
 #define declare_get_random_var_wait(var) \