diff options
Diffstat (limited to 'crypto/testmgr.c')
-rw-r--r-- | crypto/testmgr.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/crypto/testmgr.c b/crypto/testmgr.c index 44e888b0b041..881176ebd8a8 100644 --- a/crypto/testmgr.c +++ b/crypto/testmgr.c | |||
@@ -1463,13 +1463,12 @@ static int test_acomp(struct crypto_acomp *tfm, struct comp_testvec *ctemplate, | |||
1463 | int ilen = ctemplate[i].inlen; | 1463 | int ilen = ctemplate[i].inlen; |
1464 | void *input_vec; | 1464 | void *input_vec; |
1465 | 1465 | ||
1466 | input_vec = kmalloc(ilen, GFP_KERNEL); | 1466 | input_vec = kmemdup(ctemplate[i].input, ilen, GFP_KERNEL); |
1467 | if (!input_vec) { | 1467 | if (!input_vec) { |
1468 | ret = -ENOMEM; | 1468 | ret = -ENOMEM; |
1469 | goto out; | 1469 | goto out; |
1470 | } | 1470 | } |
1471 | 1471 | ||
1472 | memcpy(input_vec, ctemplate[i].input, ilen); | ||
1473 | memset(output, 0, dlen); | 1472 | memset(output, 0, dlen); |
1474 | init_completion(&result.completion); | 1473 | init_completion(&result.completion); |
1475 | sg_init_one(&src, input_vec, ilen); | 1474 | sg_init_one(&src, input_vec, ilen); |
@@ -1525,13 +1524,12 @@ static int test_acomp(struct crypto_acomp *tfm, struct comp_testvec *ctemplate, | |||
1525 | int ilen = dtemplate[i].inlen; | 1524 | int ilen = dtemplate[i].inlen; |
1526 | void *input_vec; | 1525 | void *input_vec; |
1527 | 1526 | ||
1528 | input_vec = kmalloc(ilen, GFP_KERNEL); | 1527 | input_vec = kmemdup(dtemplate[i].input, ilen, GFP_KERNEL); |
1529 | if (!input_vec) { | 1528 | if (!input_vec) { |
1530 | ret = -ENOMEM; | 1529 | ret = -ENOMEM; |
1531 | goto out; | 1530 | goto out; |
1532 | } | 1531 | } |
1533 | 1532 | ||
1534 | memcpy(input_vec, dtemplate[i].input, ilen); | ||
1535 | memset(output, 0, dlen); | 1533 | memset(output, 0, dlen); |
1536 | init_completion(&result.completion); | 1534 | init_completion(&result.completion); |
1537 | sg_init_one(&src, input_vec, ilen); | 1535 | sg_init_one(&src, input_vec, ilen); |