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,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;
......
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