Skip to content

Commit

Permalink
crypto: tcrypt - Fix leak of struct aead_request in test_aead_speed()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Marek Vasut <[email protected]>
Acked-by: Tim Chen <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
Christian Engelmayer authored and herbertx committed Apr 28, 2014
1 parent a2ea6ed commit 6af1f93
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crypto/tcrypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 6af1f93

Please sign in to comment.