提交 c70c471c 编写于 作者: D Dmitry Kasatkin 提交者: James Morris

lib/mpi: added missing NULL check

Added missing NULL check after mpi_alloc().
Signed-off-by: NDmitry Kasatkin <dmitry.kasatkin@intel.com>
Reviewed-by: NTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: NJames Morris <jmorris@namei.org>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册