diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-10-30 06:25:44 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-10-30 06:25:44 -0400 |
commit | d4608a83f78b489822d0f378acf752c8b71a750c (patch) | |
tree | f8e8751691042de8e7bad413034cbb2bb03ed2e5 /drivers/char | |
parent | e334cd69fa65fc9e916d6adc8d860a9b6b9e7281 (diff) | |
parent | a909d3e636995ba7c349e2ca5dbb528154d4ac30 (diff) | |
download | op-kernel-dev-d4608a83f78b489822d0f378acf752c8b71a750c.zip op-kernel-dev-d4608a83f78b489822d0f378acf752c8b71a750c.tar.gz |
Merge 4.9-rc3 into char-misc-next
We need the binder patches in here to build on for other submitted
patches to apply properly.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/hw_random/core.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c index 4827945..d2d2c89 100644 --- a/drivers/char/hw_random/core.c +++ b/drivers/char/hw_random/core.c @@ -84,14 +84,14 @@ static size_t rng_buffer_size(void) static void add_early_randomness(struct hwrng *rng) { - unsigned char bytes[16]; int bytes_read; + size_t size = min_t(size_t, 16, rng_buffer_size()); mutex_lock(&reading_mutex); - bytes_read = rng_get_data(rng, bytes, sizeof(bytes), 1); + bytes_read = rng_get_data(rng, rng_buffer, size, 1); mutex_unlock(&reading_mutex); if (bytes_read > 0) - add_device_randomness(bytes, bytes_read); + add_device_randomness(rng_buffer, bytes_read); } static inline void cleanup_rng(struct kref *kref) |