Skip to content
Commit c1d9702c authored by Jianglei Nie's avatar Jianglei Nie Committed by Greg Kroah-Hartman
Browse files

ima: Fix potential memory leak in ima_init_crypto()

[ Upstream commit 067d2521

 ]

On failure to allocate the SHA1 tfm, IMA fails to initialize and exits
without freeing the ima_algo_array. Add the missing kfree() for
ima_algo_array to avoid the potential memory leak.

Signed-off-by: default avatarJianglei Nie <niejianglei2021@163.com>
Fixes: 6d94809a

 ("ima: Allocate and initialize tfm for each PCR bank")
Signed-off-by: default avatarMimi Zohar <zohar@linux.ibm.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent eb360267
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