Skip to content

Commit

Permalink
crypto: iaa - Fix async_disable descriptor leak
Browse files Browse the repository at this point in the history
[ Upstream commit 262534d ]

The disable_async paths of iaa_compress/decompress() don't free idxd
descriptors in the async_disable case. Currently this only happens in
the testcases where req->dst is set to null. Add a test to free them
in those paths.

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
tzanussi authored and gregkh committed Apr 13, 2024
1 parent 0fc5116 commit d994f7d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/crypto/intel/iaa/iaa_crypto_main.c
Expand Up @@ -1328,7 +1328,7 @@ static int iaa_compress(struct crypto_tfm *tfm, struct acomp_req *req,

*compression_crc = idxd_desc->iax_completion->crc;

if (!ctx->async_mode)
if (!ctx->async_mode || disable_async)
idxd_free_desc(wq, idxd_desc);
out:
return ret;
Expand Down Expand Up @@ -1574,7 +1574,7 @@ static int iaa_decompress(struct crypto_tfm *tfm, struct acomp_req *req,

*dlen = req->dlen;

if (!ctx->async_mode)
if (!ctx->async_mode || disable_async)
idxd_free_desc(wq, idxd_desc);

/* Update stats */
Expand Down

0 comments on commit d994f7d

Please sign in to comment.