crypto: AF_ALG - return error code when no data was processed
PATCH 1/1 crypto: AF_ALG - 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 <[email protected]>
--- crypto/algif_aead.c | 4 +++- crypto/algif_skcipher.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-)
crypto/algif_aead.c +3 -1
@@ -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; }
crypto/algif_skcipher.c +3 -1
@@ -714,9 +714,11 @@ static int skcipher_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 ) +if (err == -EIOCBQUEUED || !ret) ret = err; goto out; }
Signature · 1 line
2.13.3
Herbert Xu
maintainerQuoted 8 lines · Stephan Müller
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
-EIOCBQUEUEDor-EBADMSG(like-ENOMEM), it should be relayed to the caller.Signed-off-by Stephan Mueller <[email protected]>
Patch applied. Thanks.
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt