Skip to content

Commit 6af1f93

Browse files
Christian Engelmayerherbertx
authored andcommitted
crypto: tcrypt - Fix leak of struct aead_request in test_aead_speed()
Fix leakage of memory for struct aead_request that is allocated via aead_request_alloc() but not released via aead_request_free(). Reported by Coverity - CID 1163869. Signed-off-by: Christian Engelmayer <cengelma@gmx.at> Reviewed-by: Marek Vasut <marex@denx.de> Acked-by: Tim Chen <tim.c.chen@linux.intel.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent a2ea6ed commit 6af1f93

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎crypto/tcrypt.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ static void test_aead_speed(const char *algo, int enc, unsigned int sec,
320320
if (!req) {
321321
pr_err("alg: aead: Failed to allocate request for %s\n",
322322
algo);
323-
goto out;
323+
goto out_noreq;
324324
}
325325

326326
i = 0;
@@ -390,6 +390,8 @@ static void test_aead_speed(const char *algo, int enc, unsigned int sec,
390390
} while (*keysize);
391391

392392
out:
393+
aead_request_free(req);
394+
out_noreq:
393395
crypto_free_aead(tfm);
394396
out_notfm:
395397
kfree(sg);

0 commit comments

Comments
 (0)