Skip to content

Commit 262534d

Browse files
tzanussiherbertx
authored andcommitted
crypto: iaa - Fix async_disable descriptor leak
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>
1 parent 7248e52 commit 262534d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/crypto/intel/iaa/iaa_crypto_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,7 +1222,7 @@ static int iaa_compress(struct crypto_tfm *tfm, struct acomp_req *req,
12221222

12231223
*compression_crc = idxd_desc->iax_completion->crc;
12241224

1225-
if (!ctx->async_mode)
1225+
if (!ctx->async_mode || disable_async)
12261226
idxd_free_desc(wq, idxd_desc);
12271227
out:
12281228
return ret;
@@ -1468,7 +1468,7 @@ static int iaa_decompress(struct crypto_tfm *tfm, struct acomp_req *req,
14681468

14691469
*dlen = req->dlen;
14701470

1471-
if (!ctx->async_mode)
1471+
if (!ctx->async_mode || disable_async)
14721472
idxd_free_desc(wq, idxd_desc);
14731473

14741474
/* Update stats */

0 commit comments

Comments
 (0)