diff options
| author | Dmitry Kasatkin <[email protected]> | 2012-01-26 17:13:17 +0000 |
|---|---|---|
| committer | James Morris <[email protected]> | 2012-02-01 13:23:13 +0000 |
| commit | c70c471c585a3fc1a10c792d5121b3803c83dde0 (patch) | |
| tree | 9ba56d609baafe310008974099d6d4adc77a67aa /lib/mpi/mpicoder.c | |
| parent | Linux 3.3-rc2 (diff) | |
| download | kernel-c70c471c585a3fc1a10c792d5121b3803c83dde0.tar.gz kernel-c70c471c585a3fc1a10c792d5121b3803c83dde0.zip | |
lib/mpi: added missing NULL check
Added missing NULL check after mpi_alloc().
Signed-off-by: Dmitry Kasatkin <[email protected]>
Reviewed-by: Tetsuo Handa <[email protected]>
Signed-off-by: James Morris <[email protected]>
Diffstat (limited to 'lib/mpi/mpicoder.c')
| -rw-r--r-- | lib/mpi/mpicoder.c | 3 |
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) } a = mpi_alloc((nframe + BYTES_PER_MPI_LIMB - 1) / BYTES_PER_MPI_LIMB); - mpi_set_buffer(a, frame, nframe, 0); + if (a) + mpi_set_buffer(a, frame, nframe, 0); kfree(frame); return a; |
