summaryrefslogtreecommitdiffstats
path: root/lib/mpi
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2017-08-22 08:53:32 +0200
committerHerbert Xu <herbert@gondor.apana.org.au>2017-08-22 08:53:32 +0200
commite90c48efde40f8428777424e6edbbb240b441652 (patch)
treec023a7a8fa0255f03040c63a73068eaaca03f1af /lib/mpi
parentcrypto: ccp - use dma_mapping_error to check map error (diff)
parentcrypto: algif_skcipher - only call put_page on referenced and used pages (diff)
downloadlinux-e90c48efde40f8428777424e6edbbb240b441652.tar.xz
linux-e90c48efde40f8428777424e6edbbb240b441652.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Merge the crypto tree to resolve the conflict between the temporary and long-term fixes in algif_skcipher.
Diffstat (limited to 'lib/mpi')
-rw-r--r--lib/mpi/mpicoder.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/mpi/mpicoder.c b/lib/mpi/mpicoder.c
index 5a0f75a3bf01..eead4b339466 100644
--- a/lib/mpi/mpicoder.c
+++ b/lib/mpi/mpicoder.c
@@ -364,11 +364,11 @@ MPI mpi_read_raw_from_sgl(struct scatterlist *sgl, unsigned int nbytes)
}
miter.consumed = lzeros;
- sg_miter_stop(&miter);
nbytes -= lzeros;
nbits = nbytes * 8;
if (nbits > MAX_EXTERN_MPI_BITS) {
+ sg_miter_stop(&miter);
pr_info("MPI: mpi too large (%u bits)\n", nbits);
return NULL;
}
@@ -376,6 +376,8 @@ MPI mpi_read_raw_from_sgl(struct scatterlist *sgl, unsigned int nbytes)
if (nbytes > 0)
nbits -= count_leading_zeros(*buff) - (BITS_PER_LONG - 8);
+ sg_miter_stop(&miter);
+
nlimbs = DIV_ROUND_UP(nbytes, BYTES_PER_MPI_LIMB);
val = mpi_alloc(nlimbs);
if (!val)