diff options
| author | Christian Engelmayer <cengelma@gmx.at> | 2014-04-21 14:47:05 -0400 |
|---|---|---|
| committer | Herbert Xu <herbert@gondor.apana.org.au> | 2014-04-28 06:21:18 -0400 |
| commit | 6af1f93e2a0192fb1efbe82a5fef53d71cbe218b (patch) | |
| tree | 4a293e06c5bfc608fcaea36108ae2edf3feecb2e /crypto | |
| parent | a2ea6ed6a631e24d315b5f2bd468e6f4c7ff2e48 (diff) | |
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>
Diffstat (limited to 'crypto')
| -rw-r--r-- | crypto/tcrypt.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c index 18491552b83a..09c93ff216e4 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, | |||
| 320 | if (!req) { | 320 | if (!req) { |
| 321 | pr_err("alg: aead: Failed to allocate request for %s\n", | 321 | pr_err("alg: aead: Failed to allocate request for %s\n", |
| 322 | algo); | 322 | algo); |
| 323 | goto out; | 323 | goto out_noreq; |
| 324 | } | 324 | } |
| 325 | 325 | ||
| 326 | i = 0; | 326 | i = 0; |
| @@ -390,6 +390,8 @@ static void test_aead_speed(const char *algo, int enc, unsigned int sec, | |||
| 390 | } while (*keysize); | 390 | } while (*keysize); |
| 391 | 391 | ||
| 392 | out: | 392 | out: |
| 393 | aead_request_free(req); | ||
| 394 | out_noreq: | ||
| 393 | crypto_free_aead(tfm); | 395 | crypto_free_aead(tfm); |
| 394 | out_notfm: | 396 | out_notfm: |
| 395 | kfree(sg); | 397 | kfree(sg); |
