summaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
authorZhang Yiqun <zhangyiqun@phytium.com.cn>2022-11-16 17:24:11 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-12-31 13:26:20 +0100
commit4751b1064239e37371ba87c50dc1439d45d79ef6 (patch)
tree1f61e66e03d35e0f23eaf3724c1988e325b09190 /crypto
parentfc998d0a7d65672f0812f11cd0ec4bbe4f8f8507 (diff)
downloadlinux-4751b1064239e37371ba87c50dc1439d45d79ef6.tar.gz
linux-4751b1064239e37371ba87c50dc1439d45d79ef6.tar.bz2
linux-4751b1064239e37371ba87c50dc1439d45d79ef6.zip
crypto: tcrypt - Fix multibuffer skcipher speed test mem leak
[ Upstream commit 1aa33fc8d4032227253ceb736f47c52b859d9683 ] In the past, the data for mb-skcipher test has been allocated twice, that means the first allcated memory area is without free, which may cause a potential memory leakage. So this patch is to remove one allocation to fix this error. Fixes: e161c5930c15 ("crypto: tcrypt - add multibuf skcipher...") Signed-off-by: Zhang Yiqun <zhangyiqun@phytium.com.cn> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'crypto')
-rw-r--r--crypto/tcrypt.c9
1 files changed, 0 insertions, 9 deletions
diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c
index 574640210c80..bc57b182f304 100644
--- a/crypto/tcrypt.c
+++ b/crypto/tcrypt.c
@@ -1101,15 +1101,6 @@ static void test_mb_skcipher_speed(const char *algo, int enc, int secs,
goto out_free_tfm;
}
-
- for (i = 0; i < num_mb; ++i)
- if (testmgr_alloc_buf(data[i].xbuf)) {
- while (i--)
- testmgr_free_buf(data[i].xbuf);
- goto out_free_tfm;
- }
-
-
for (i = 0; i < num_mb; ++i) {
data[i].req = skcipher_request_alloc(tfm, GFP_KERNEL);
if (!data[i].req) {