diff options
author | Tadeusz Struk <tadeusz.struk@intel.com> | 2015-05-15 10:18:37 -0700 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2015-05-18 12:13:06 +0800 |
commit | 8b7fcb1ae794ff4e00b4e2e152879715e50602de (patch) | |
tree | 1511bf9c3bc9f703307b96bbd0a8cba3575cb898 | |
parent | d6648305e24043502a8b44b913ca32bef4884674 (diff) | |
download | linux-crypto-8b7fcb1ae794ff4e00b4e2e152879715e50602de.tar.gz linux-crypto-8b7fcb1ae794ff4e00b4e2e152879715e50602de.zip |
crypto: algif_aead - fix invalid sgl linking
This patch fixes it.
Also minor updates to comments.
Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to '')
-rw-r--r-- | crypto/algif_aead.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/crypto/algif_aead.c b/crypto/algif_aead.c index 00a6fe16..69abada2 100644 --- a/crypto/algif_aead.c +++ b/crypto/algif_aead.c @@ -33,7 +33,7 @@ struct aead_ctx { /* * RSGL_MAX_ENTRIES is an artificial limit where user space at maximum * can cause the kernel to allocate RSGL_MAX_ENTRIES * ALG_MAX_PAGES - * bytes + * pages */ #define RSGL_MAX_ENTRIES ALG_MAX_PAGES struct af_alg_sgl rsgl[RSGL_MAX_ENTRIES]; @@ -435,11 +435,10 @@ static int aead_recvmsg(struct socket *sock, struct msghdr *msg, size_t ignored, if (err < 0) goto unlock; usedpages += err; - /* chain the new scatterlist with initial list */ + /* chain the new scatterlist with previous one */ if (cnt) - scatterwalk_crypto_chain(ctx->rsgl[0].sg, - ctx->rsgl[cnt].sg, 1, - sg_nents(ctx->rsgl[cnt-1].sg)); + af_alg_link_sg(&ctx->rsgl[cnt-1], &ctx->rsgl[cnt]); + /* we do not need more iovecs as we have sufficient memory */ if (outlen <= usedpages) break; |