diff options
Diffstat (limited to 'arch/s390/crypto/prng.c')
-rw-r--r-- | arch/s390/crypto/prng.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/s390/crypto/prng.c b/arch/s390/crypto/prng.c index aa819dac2360..0808fbf0f7d3 100644 --- a/arch/s390/crypto/prng.c +++ b/arch/s390/crypto/prng.c | |||
@@ -76,7 +76,7 @@ static void prng_seed(int nbytes) | |||
76 | 76 | ||
77 | /* Add the entropy */ | 77 | /* Add the entropy */ |
78 | while (nbytes >= 8) { | 78 | while (nbytes >= 8) { |
79 | *((__u64 *)parm_block) ^= *((__u64 *)buf+i*8); | 79 | *((__u64 *)parm_block) ^= *((__u64 *)(buf+i)); |
80 | prng_add_entropy(); | 80 | prng_add_entropy(); |
81 | i += 8; | 81 | i += 8; |
82 | nbytes -= 8; | 82 | nbytes -= 8; |
@@ -152,6 +152,7 @@ static const struct file_operations prng_fops = { | |||
152 | .open = &prng_open, | 152 | .open = &prng_open, |
153 | .release = NULL, | 153 | .release = NULL, |
154 | .read = &prng_read, | 154 | .read = &prng_read, |
155 | .llseek = noop_llseek, | ||
155 | }; | 156 | }; |
156 | 157 | ||
157 | static struct miscdevice prng_dev = { | 158 | static struct miscdevice prng_dev = { |
@@ -165,7 +166,7 @@ static int __init prng_init(void) | |||
165 | int ret; | 166 | int ret; |
166 | 167 | ||
167 | /* check if the CPU has a PRNG */ | 168 | /* check if the CPU has a PRNG */ |
168 | if (!crypt_s390_func_available(KMC_PRNG)) | 169 | if (!crypt_s390_func_available(KMC_PRNG, CRYPT_S390_MSA)) |
169 | return -EOPNOTSUPP; | 170 | return -EOPNOTSUPP; |
170 | 171 | ||
171 | if (prng_chunk_size < 8) | 172 | if (prng_chunk_size < 8) |