Skip to content

Commit

Permalink
crypto: algif_skcipher - Pass on error from af_alg_make_sg
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
herbertx committed Nov 28, 2010
1 parent 887c883 commit c762be6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crypto/algif_skcipher.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit c762be6

Please sign in to comment.