evm: Fix memleak in init_desc
authorDinghao Liu <dinghao.liu@zju.edu.cn>
Sun, 10 Jan 2021 08:02:53 +0000 (16:02 +0800)
committerMimi Zohar <zohar@linux.ibm.com>
Wed, 13 Jan 2021 12:22:12 +0000 (07:22 -0500)
commitccf11dbaa07b328fa469415c362d33459c140a37
tree34c1acb7bb4be53c6899a9c7d2302747ad48b768
parent7c53f6b671f4aba70ff15e1b05148b10d58c2837
evm: Fix memleak in init_desc

tmp_tfm is allocated, but not freed on subsequent kmalloc failure, which
leads to a memory leak.  Free tmp_tfm.

Fixes: d46eb3699502b ("evm: crypto hash replaced by shash")
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
[zohar@linux.ibm.com: formatted/reworded patch description]
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
security/integrity/evm/evm_crypto.c