aboutsummaryrefslogtreecommitdiffstats
path: root/lib/mpi/mpicoder.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mpi/mpicoder.c')
-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)
364 } 364 }
365 365
366 miter.consumed = lzeros; 366 miter.consumed = lzeros;
367 sg_miter_stop(&miter);
368 367
369 nbytes -= lzeros; 368 nbytes -= lzeros;
370 nbits = nbytes * 8; 369 nbits = nbytes * 8;
371 if (nbits > MAX_EXTERN_MPI_BITS) { 370 if (nbits > MAX_EXTERN_MPI_BITS) {
371 sg_miter_stop(&miter);
372 pr_info("MPI: mpi too large (%u bits)\n", nbits); 372 pr_info("MPI: mpi too large (%u bits)\n", nbits);
373 return NULL; 373 return NULL;
374 } 374 }
@@ -376,6 +376,8 @@ MPI mpi_read_raw_from_sgl(struct scatterlist *sgl, unsigned int nbytes)
376 if (nbytes > 0) 376 if (nbytes > 0)
377 nbits -= count_leading_zeros(*buff) - (BITS_PER_LONG - 8); 377 nbits -= count_leading_zeros(*buff) - (BITS_PER_LONG - 8);
378 378
379 sg_miter_stop(&miter);
380
379 nlimbs = DIV_ROUND_UP(nbytes, BYTES_PER_MPI_LIMB); 381 nlimbs = DIV_ROUND_UP(nbytes, BYTES_PER_MPI_LIMB);
380 val = mpi_alloc(nlimbs); 382 val = mpi_alloc(nlimbs);
381 if (!val) 383 if (!val)