s390/crypto: unlock on error in prng_tdes_read()
We added some new locking but forgot to unlock on error.
Fixes: 57127645d7
("s390/zcrypt: Introduce new SHA-512 based Pseudo Random Generator.")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
This commit is contained in:
parent
e32eae10e5
commit
9e6e7c7431
|
@ -507,8 +507,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;
|
||||
|
|
Loading…
Reference in New Issue