diff options
author | Dmitry Kasatkin <dmitry.kasatkin@intel.com> | 2012-01-26 12:13:18 -0500 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2012-02-01 08:23:39 -0500 |
commit | 43b2c0aeaab2237996a72f9b9d7952ba82d56913 (patch) | |
tree | d685ff8357eafe11ffab7d42bf4e7d3fd81cb97c /lib/mpi | |
parent | a6d68ecc56ed182644c81ef6917ce1f5404db7dd (diff) |
lib/mpi: added missing NULL check
Added missing NULL check after mpi_alloc_limb_space().
Signed-off-by: Dmitry Kasatkin <dmitry.kasatkin@intel.com>
Reviewed-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'lib/mpi')
-rw-r--r-- | lib/mpi/mpi-div.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/mpi/mpi-div.c b/lib/mpi/mpi-div.c index 8a45717bd001..f68cbbb4d4a4 100644 --- a/lib/mpi/mpi-div.c +++ b/lib/mpi/mpi-div.c | |||
@@ -210,6 +210,8 @@ int mpi_tdiv_qr(MPI quot, MPI rem, MPI num, MPI den) | |||
210 | * numerator would be gradually overwritten by the quotient limbs. */ | 210 | * numerator would be gradually overwritten by the quotient limbs. */ |
211 | if (qp == np) { /* Copy NP object to temporary space. */ | 211 | if (qp == np) { /* Copy NP object to temporary space. */ |
212 | np = marker[markidx++] = mpi_alloc_limb_space(nsize); | 212 | np = marker[markidx++] = mpi_alloc_limb_space(nsize); |
213 | if (!np) | ||
214 | goto nomem; | ||
213 | MPN_COPY(np, qp, nsize); | 215 | MPN_COPY(np, qp, nsize); |
214 | } | 216 | } |
215 | } else /* Put quotient at top of remainder. */ | 217 | } else /* Put quotient at top of remainder. */ |