summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Engelmayer <cengelma@gmx.at>2014-04-21 20:47:05 +0200
committerHerbert Xu <herbert@gondor.apana.org.au>2014-04-28 18:21:18 +0800
commitef4c4536ea92681ca9632b9062840aef3b89567f (patch)
tree462705ebab4149f08e527eb8874a9fc548935d9c
parent0c41fd0804d196cbc86fb4ea4859d2b27a4ade11 (diff)
downloadlinux-crypto-ef4c4536ea92681ca9632b9062840aef3b89567f.tar.gz
linux-crypto-ef4c4536ea92681ca9632b9062840aef3b89567f.zip
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>
-rw-r--r--crypto/tcrypt.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c
index 18491552..09c93ff2 100644
--- a/crypto/tcrypt.c
+++ b/crypto/tcrypt.c
@@ -320,7 +320,7 @@ static void test_aead_speed(const char *algo, int enc, unsigned int sec,
if (!req) {
pr_err("alg: aead: Failed to allocate request for %s\n",
algo);
- goto out;
+ goto out_noreq;
}
i = 0;
@@ -390,6 +390,8 @@ static void test_aead_speed(const char *algo, int enc, unsigned int sec,
} while (*keysize);
out:
+ aead_request_free(req);
+out_noreq:
crypto_free_aead(tfm);
out_notfm:
kfree(sg);