]> Git Repo - linux.git/commitdiff
fix typo/thinko in get_random_bytes()
authorLuck, Tony <[email protected]>
Wed, 16 Nov 2011 18:50:56 +0000 (10:50 -0800)
committerLinus Torvalds <[email protected]>
Thu, 17 Nov 2011 13:42:54 +0000 (11:42 -0200)
If there is an architecture-specific random number generator we use it
to acquire randomness one "long" at a time.  We should put these random
words into consecutive words in the result buffer - not just overwrite
the first word again and again.

Signed-off-by: Tony Luck <[email protected]>
Acked-by: H. Peter Anvin <[email protected]>
Acked-by: Thomas Gleixner <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
drivers/char/random.c

index 63e19ba56bbea5a12ee784f023bd13a758eaf611..6035ab8d5ef7e25e6eae89fbfdc53476f248de8b 100644 (file)
@@ -941,7 +941,7 @@ void get_random_bytes(void *buf, int nbytes)
                if (!arch_get_random_long(&v))
                        break;
                
-               memcpy(buf, &v, chunk);
+               memcpy(p, &v, chunk);
                p += chunk;
                nbytes -= chunk;
        }
This page took 0.053502 seconds and 4 git commands to generate.