Переглянути джерело

crypto: algif_skcipher - Pass on error from af_alg_make_sg

The error returned from af_alg_make_sg is currently lost and we
always pass on -EINVAL.  This patch pases on the underlying error.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Herbert Xu 14 роки тому
батько
коміт
c762be6375
1 змінених файлів з 2 додано та 1 видалено
  1. 2 1
      crypto/algif_skcipher.c

+ 2 - 1
crypto/algif_skcipher.c

@@ -472,7 +472,8 @@ static int skcipher_recvmsg(struct kiocb *unused, struct socket *sock,
 				goto unlock;
 
 			used = af_alg_make_sg(&ctx->rsgl, from, used, 1);
-			if (used < 0)
+			err = used;
+			if (err < 0)
 				goto unlock;
 
 			ablkcipher_request_set_crypt(&ctx->req, sg,