crypto: tegra: Free CMAC fallback tfm during exit

Free the CMAC fallback tfm to fix the memory leak during CMAC operation.
The fallback tfm is setup during init but never freed.

Signed-off-by: Akhil R <akhilrajeev@nvidia.com>
Change-Id: Icb9ccf330f94e93459c241ed7105a221832c0514
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2998701
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Akhil R
2023-10-17 14:12:36 +05:30
committed by mobile promotions
parent 1d58216b05
commit 7cf41996cb

View File

@@ -1664,6 +1664,9 @@ static void tegra_cmac_cra_exit(struct crypto_tfm *tfm)
struct tegra_cmac_ctx *ctx = crypto_tfm_ctx(tfm);
tegra_key_invalidate(ctx->se, ctx->key_id);
if (ctx->fallback_tfm)
crypto_free_shash(ctx->fallback_tfm);
}
static int tegra_cmac_init(struct ahash_request *req)