mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 13:55:32 +00:00
crypto: hisilicon/sec - Fix memory leak for sec resource release
[ Upstream commit bba4250757
]
The AIV is one of the SEC resources. When releasing resources,
it need to release the AIV resources at the same time.
Otherwise, memory leakage occurs.
The aiv resource release is added to the sec resource release
function.
Signed-off-by: Chenghai Huang <huangchenghai2@huawei.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
c0643d07f8
commit
36810d2db3
1 changed files with 3 additions and 1 deletions
|
@ -481,8 +481,10 @@ static void sec_alg_resource_free(struct sec_ctx *ctx,
|
||||||
|
|
||||||
if (ctx->pbuf_supported)
|
if (ctx->pbuf_supported)
|
||||||
sec_free_pbuf_resource(dev, qp_ctx->res);
|
sec_free_pbuf_resource(dev, qp_ctx->res);
|
||||||
if (ctx->alg_type == SEC_AEAD)
|
if (ctx->alg_type == SEC_AEAD) {
|
||||||
sec_free_mac_resource(dev, qp_ctx->res);
|
sec_free_mac_resource(dev, qp_ctx->res);
|
||||||
|
sec_free_aiv_resource(dev, qp_ctx->res);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int sec_alloc_qp_ctx_resource(struct sec_ctx *ctx, struct sec_qp_ctx *qp_ctx)
|
static int sec_alloc_qp_ctx_resource(struct sec_ctx *ctx, struct sec_qp_ctx *qp_ctx)
|
||||||
|
|
Loading…
Reference in a new issue