summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTadeusz Struk <tadeusz.struk@intel.com>2014-05-19 09:51:33 -0700
committerNitin Garg <nitin.garg@freescale.com>2014-09-18 12:48:43 -0500
commit8ab15a209a92b62f72e3721dd1780baac59d7082 (patch)
tree16c713ed4393811c2beebab48c570bf3cbc06fc5
parent7525ee3443e74c613425a42f5c2c3141f3ec9c57 (diff)
crypto: testmgr - Fix DMA-API warning
With DMA-API debug enabled testmgr triggers a "DMA-API: device driver maps memory from stack" warning, when tested on a crypto HW accelerator. Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r--crypto/testmgr.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/crypto/testmgr.c b/crypto/testmgr.c
index 5823735cf381..940a508a0f75 100644
--- a/crypto/testmgr.c
+++ b/crypto/testmgr.c
@@ -377,16 +377,18 @@ static int __test_aead(struct crypto_aead *tfm, int enc,
void *input;
void *output;
void *assoc;
- char iv[MAX_IVLEN];
+ char *iv;
char *xbuf[XBUFSIZE];
char *xoutbuf[XBUFSIZE];
char *axbuf[XBUFSIZE];
+ iv = kzalloc(MAX_IVLEN, GFP_KERNEL);
+ if (!iv)
+ return ret;
if (testmgr_alloc_buf(xbuf))
goto out_noxbuf;
if (testmgr_alloc_buf(axbuf))
goto out_noaxbuf;
-
if (diff_dst && testmgr_alloc_buf(xoutbuf))
goto out_nooutbuf;
@@ -726,6 +728,7 @@ out_nooutbuf:
out_noaxbuf:
testmgr_free_buf(xbuf);
out_noxbuf:
+ kfree(iv);
return ret;
}