summaryrefslogtreecommitdiffstats
path: root/crypto/algif_skcipher.c
diff options
context:
space:
mode:
authorStephan Mueller <smueller@chronox.de>2017-07-30 08:31:18 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2017-08-09 08:17:50 -0400
commit5703c826b758e0b33c998739af093879979315b8 (patch)
tree71296be72e8bcae1f539da6c212cdb24fbb98668 /crypto/algif_skcipher.c
parent5060ffc97bc6fdd31595b3ecbc027b0a8df94b5c (diff)
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_skcipher.c')
-rw-r--r--crypto/algif_skcipher.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/crypto/algif_skcipher.c b/crypto/algif_skcipher.c
index 968d094f0bcc..ce3b5fba2279 100644
--- a/crypto/algif_skcipher.c
+++ b/crypto/algif_skcipher.c
@@ -714,9 +714,11 @@ static int skcipher_recvmsg(struct socket *sock, struct msghdr *msg,
714 * only handle one AIO request. If the caller wants to have 714 * only handle one AIO request. If the caller wants to have
715 * multiple AIO requests in parallel, he must make multiple 715 * multiple AIO requests in parallel, he must make multiple
716 * separate AIO calls. 716 * separate AIO calls.
717 *
718 * Also return the error if no data has been processed so far.
717 */ 719 */
718 if (err <= 0) { 720 if (err <= 0) {
719 if (err == -EIOCBQUEUED) 721 if (err == -EIOCBQUEUED || !ret)
720 ret = err; 722 ret = err;
721 goto out; 723 goto out;
722 } 724 }