]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: tcrypt - Fix memory leaks/crashes in multibuffer hash speed test
authorHerbert Xu <herbert@gondor.apana.org.au>
Tue, 28 Jun 2016 12:33:52 +0000 (20:33 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Wed, 29 Jun 2016 10:12:42 +0000 (18:12 +0800)
commitc549ec0be41dd73bbfc196b036e6aa25c07e523e
treecb3c073874339ae6ad080fa3b0ad96dc0c2c6601
parent534063d3f93fccc6f0a33a0e3a3d2e600837f34a
crypto: tcrypt - Fix memory leaks/crashes in multibuffer hash speed test

This patch resolves a number of issues with the mb speed test
function:

* The tfm is never freed.
* Memory is allocated even when we're not using mb.
* When an error occurs we don't wait for completion for other requests.
* When an error occurs during allocation we may leak memory.
* The test function ignores plen but still runs for plen != blen.
* The backlog flag is incorrectly used (may crash).

This patch tries to resolve all these issues as well as making
the code consistent with the existing hash speed testing function.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Tested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
crypto/tcrypt.c