diff options
author | Ingo Molnar <mingo@elte.hu> | 2012-03-14 04:48:16 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2012-03-14 04:48:16 -0400 |
commit | c96a9876696d30783ad54399351a0bf3660db53f (patch) | |
tree | 74daba0ed1fd2838e8eb527c4f7fe5262ee979bd /lib/mpi/mpi-div.c | |
parent | d1f42e314c9c50541c79a6edf2b4cab63fe02ee3 (diff) | |
parent | fde7d9049e55ab85a390be7f415d74c9f62dd0f9 (diff) |
Merge tag 'v3.3-rc7' into x86/platform
Merge reason: Update to the almost-final v3.3 kernel.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'lib/mpi/mpi-div.c')
-rw-r--r-- | lib/mpi/mpi-div.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/mpi/mpi-div.c b/lib/mpi/mpi-div.c index c3087d1390ce..f68cbbb4d4a4 100644 --- a/lib/mpi/mpi-div.c +++ b/lib/mpi/mpi-div.c | |||
@@ -149,6 +149,9 @@ int mpi_tdiv_qr(MPI quot, MPI rem, MPI num, MPI den) | |||
149 | mpi_ptr_t marker[5]; | 149 | mpi_ptr_t marker[5]; |
150 | int markidx = 0; | 150 | int markidx = 0; |
151 | 151 | ||
152 | if (!dsize) | ||
153 | return -EINVAL; | ||
154 | |||
152 | memset(marker, 0, sizeof(marker)); | 155 | memset(marker, 0, sizeof(marker)); |
153 | 156 | ||
154 | /* Ensure space is enough for quotient and remainder. | 157 | /* Ensure space is enough for quotient and remainder. |
@@ -207,6 +210,8 @@ int mpi_tdiv_qr(MPI quot, MPI rem, MPI num, MPI den) | |||
207 | * numerator would be gradually overwritten by the quotient limbs. */ | 210 | * numerator would be gradually overwritten by the quotient limbs. */ |
208 | if (qp == np) { /* Copy NP object to temporary space. */ | 211 | if (qp == np) { /* Copy NP object to temporary space. */ |
209 | np = marker[markidx++] = mpi_alloc_limb_space(nsize); | 212 | np = marker[markidx++] = mpi_alloc_limb_space(nsize); |
213 | if (!np) | ||
214 | goto nomem; | ||
210 | MPN_COPY(np, qp, nsize); | 215 | MPN_COPY(np, qp, nsize); |
211 | } | 216 | } |
212 | } else /* Put quotient at top of remainder. */ | 217 | } else /* Put quotient at top of remainder. */ |