summaryrefslogtreecommitdiff
path: root/crypto/algif_aead.c
diff options
context:
space:
mode:
authorStephan Mueller <smueller@chronox.de>2017-07-30 14:31:18 +0200
committerHerbert Xu <herbert@gondor.apana.org.au>2017-08-09 20:17:50 +0800
commitd57f826edc9eb90ad0883370453c8dfb078a4f59 (patch)
tree26b0e59f00226ca4c46a1dc147e7ed9d6e88448f /crypto/algif_aead.c
parent96692cfc16dbe9963fc4129527fbf2f16c68f5ba (diff)
downloadlinux-crypto-d57f826edc9eb90ad0883370453c8dfb078a4f59.tar.gz
linux-crypto-d57f826edc9eb90ad0883370453c8dfb078a4f59.zip
crypto: algif - return error code when no data was processed
If no data has been processed during recvmsg, return the error code. This covers all errors received during non-AIO operations. If any error occurs during a synchronous operation in addition to -EIOCBQUEUED or -EBADMSG (like -ENOMEM), it should be relayed to the caller. Signed-off-by: Stephan Mueller <smueller@chronox.de> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/algif_aead.c')
-rw-r--r--crypto/algif_aead.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/crypto/algif_aead.c b/crypto/algif_aead.c
index 9755aac0..2de056c3 100644
--- a/crypto/algif_aead.c
+++ b/crypto/algif_aead.c
@@ -791,9 +791,11 @@ static int aead_recvmsg(struct socket *sock, struct msghdr *msg,
* only handle one AIO request. If the caller wants to have
* multiple AIO requests in parallel, he must make multiple
* separate AIO calls.
+ *
+ * Also return the error if no data has been processed so far.
*/
if (err <= 0) {
- if (err == -EIOCBQUEUED || err == -EBADMSG)
+ if (err == -EIOCBQUEUED || err == -EBADMSG || !ret)
ret = err;
goto out;
}