summaryrefslogtreecommitdiffstats
path: root/kernel/arch/s390/crypto/prng.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/arch/s390/crypto/prng.c')
-rw-r--r--kernel/arch/s390/crypto/prng.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/kernel/arch/s390/crypto/prng.c b/kernel/arch/s390/crypto/prng.c
index b8045b97f..683a966b5 100644
--- a/kernel/arch/s390/crypto/prng.c
+++ b/kernel/arch/s390/crypto/prng.c
@@ -565,8 +565,10 @@ static ssize_t prng_tdes_read(struct file *file, char __user *ubuf,
prng_data->prngws.byte_counter += n;
prng_data->prngws.reseed_counter += n;
- if (copy_to_user(ubuf, prng_data->buf, chunk))
- return -EFAULT;
+ if (copy_to_user(ubuf, prng_data->buf, chunk)) {
+ ret = -EFAULT;
+ break;
+ }
nbytes -= chunk;
ret += chunk;
@@ -669,11 +671,13 @@ static const struct file_operations prng_tdes_fops = {
static struct miscdevice prng_sha512_dev = {
.name = "prandom",
.minor = MISC_DYNAMIC_MINOR,
+ .mode = 0644,
.fops = &prng_sha512_fops,
};
static struct miscdevice prng_tdes_dev = {
.name = "prandom",
.minor = MISC_DYNAMIC_MINOR,
+ .mode = 0644,
.fops = &prng_tdes_fops,
};