Skip to content

Commit fd9d291

Browse files
Chenghai Huangroxanan1996
authored andcommitted
crypto: hisilicon/sec - Fix memory leak for sec resource release
BugLink: https://bugs.launchpad.net/bugs/2073765 [ Upstream commit bba4250 ] 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> Signed-off-by: Portia Stephens <portia.stephens@canonical.com> Signed-off-by: Roxana Nicolescu <roxana.nicolescu@canonical.com>
1 parent 75f7ba6 commit fd9d291

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/crypto/hisilicon/sec2/sec_crypto.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,8 +463,10 @@ static void sec_alg_resource_free(struct sec_ctx *ctx,
463463

464464
if (ctx->pbuf_supported)
465465
sec_free_pbuf_resource(dev, qp_ctx->res);
466-
if (ctx->alg_type == SEC_AEAD)
466+
if (ctx->alg_type == SEC_AEAD) {
467467
sec_free_mac_resource(dev, qp_ctx->res);
468+
sec_free_aiv_resource(dev, qp_ctx->res);
469+
}
468470
}
469471

470472
static int sec_create_qp_ctx(struct hisi_qm *qm, struct sec_ctx *ctx,

0 commit comments

Comments
 (0)