Commit c70c471c authored by Dmitry Kasatkin's avatar Dmitry Kasatkin Committed by James Morris

lib/mpi: added missing NULL check

Added missing NULL check after mpi_alloc().
Signed-off-by: default avatarDmitry Kasatkin <dmitry.kasatkin@intel.com>
Reviewed-by: default avatarTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: default avatarJames Morris <jmorris@namei.org>
parent 62aa2b53
...@@ -79,6 +79,7 @@ MPI do_encode_md(const void *sha_buffer, unsigned nbits) ...@@ -79,6 +79,7 @@ MPI do_encode_md(const void *sha_buffer, unsigned nbits)
} }
a = mpi_alloc((nframe + BYTES_PER_MPI_LIMB - 1) / BYTES_PER_MPI_LIMB); a = mpi_alloc((nframe + BYTES_PER_MPI_LIMB - 1) / BYTES_PER_MPI_LIMB);
if (a)
mpi_set_buffer(a, frame, nframe, 0); mpi_set_buffer(a, frame, nframe, 0);
kfree(frame); kfree(frame);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment