aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDmitry Kasatkin <dmitry.kasatkin@intel.com>2012-01-26 12:13:17 -0500
committerJames Morris <jmorris@namei.org>2012-02-01 08:23:13 -0500
commitc70c471c585a3fc1a10c792d5121b3803c83dde0 (patch)
tree9ba56d609baafe310008974099d6d4adc77a67aa /lib
parent62aa2b537c6f5957afd98e29f96897419ed5ebab (diff)
lib/mpi: added missing NULL check
Added missing NULL check after mpi_alloc(). 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')
-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 716802b774ea..6116fc4990da 100644
--- a/lib/mpi/mpicoder.c
+++ b/lib/mpi/mpicoder.c
@@ -79,7 +79,8 @@ MPI do_encode_md(const void *sha_buffer, unsigned nbits)
79 } 79 }
80 80
81 a = mpi_alloc((nframe + BYTES_PER_MPI_LIMB - 1) / BYTES_PER_MPI_LIMB); 81 a = mpi_alloc((nframe + BYTES_PER_MPI_LIMB - 1) / BYTES_PER_MPI_LIMB);
82 mpi_set_buffer(a, frame, nframe, 0); 82 if (a)
83 mpi_set_buffer(a, frame, nframe, 0);
83 kfree(frame); 84 kfree(frame);
84 85
85 return a; 86 return a;