Commit 1aa33fc8 authored by Zhang Yiqun's avatar Zhang Yiqun Committed by Herbert Xu

crypto: tcrypt - Fix multibuffer skcipher speed test mem leak

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: e161c593 ("crypto: tcrypt - add multibuf skcipher...")
Signed-off-by: default avatarZhang Yiqun <zhangyiqun@phytium.com.cn>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 441cb1b7
...@@ -1090,15 +1090,6 @@ static void test_mb_skcipher_speed(const char *algo, int enc, int secs, ...@@ -1090,15 +1090,6 @@ static void test_mb_skcipher_speed(const char *algo, int enc, int secs,
goto out_free_tfm; 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) { for (i = 0; i < num_mb; ++i) {
data[i].req = skcipher_request_alloc(tfm, GFP_KERNEL); data[i].req = skcipher_request_alloc(tfm, GFP_KERNEL);
if (!data[i].req) { if (!data[i].req) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment