提交 9e6e7c74 编写于 作者: D Dan Carpenter 提交者: Martin Schwidefsky

s390/crypto: unlock on error in prng_tdes_read()

We added some new locking but forgot to unlock on error.

Fixes: 57127645 ("s390/zcrypt: Introduce new SHA-512 based Pseudo Random Generator.")
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
上级 e32eae10
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册