Skip to content

Commit bba4250

Browse files
Chenghai Huangherbertx
authored andcommitted
crypto: hisilicon/sec - Fix memory leak for sec resource release
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>
1 parent 0a6e038 commit bba4250

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
@@ -481,8 +481,10 @@ static void sec_alg_resource_free(struct sec_ctx *ctx,
481481

482482
if (ctx->pbuf_supported)
483483
sec_free_pbuf_resource(dev, qp_ctx->res);
484-
if (ctx->alg_type == SEC_AEAD)
484+
if (ctx->alg_type == SEC_AEAD) {
485485
sec_free_mac_resource(dev, qp_ctx->res);
486+
sec_free_aiv_resource(dev, qp_ctx->res);
487+
}
486488
}
487489

488490
static int sec_alloc_qp_ctx_resource(struct sec_ctx *ctx, struct sec_qp_ctx *qp_ctx)

0 commit comments

Comments
 (0)