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.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/mpi/mpicoder.c b/lib/mpi/mpicoder.c
index 27703aad287a..24a015513b40 100644
--- a/lib/mpi/mpicoder.c
+++ b/lib/mpi/mpicoder.c
@@ -460,7 +460,8 @@ MPI mpi_read_raw_from_sgl(struct scatterlist *sgl, unsigned int nbytes)
460 } 460 }
461 461
462 if (nbytes > 0) 462 if (nbytes > 0)
463 nbits -= count_leading_zeros(*(u8 *)(sg_virt(sgl) + lzeros)); 463 nbits -= count_leading_zeros(*(u8 *)(sg_virt(sgl) + lzeros)) -
464 (BITS_PER_LONG - 8);
464 465
465 nlimbs = DIV_ROUND_UP(nbytes, BYTES_PER_MPI_LIMB); 466 nlimbs = DIV_ROUND_UP(nbytes, BYTES_PER_MPI_LIMB);
466 val = mpi_alloc(nlimbs); 467 val = mpi_alloc(nlimbs);