Commit 9bac019d authored by Tadeusz Struk's avatar Tadeusz Struk Committed by Herbert Xu

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: default avatarTadeusz Struk <tadeusz.struk@intel.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 51a71634
...@@ -414,16 +414,18 @@ static int __test_aead(struct crypto_aead *tfm, int enc, ...@@ -414,16 +414,18 @@ static int __test_aead(struct crypto_aead *tfm, int enc,
void *input; void *input;
void *output; void *output;
void *assoc; void *assoc;
char iv[MAX_IVLEN]; char *iv;
char *xbuf[XBUFSIZE]; char *xbuf[XBUFSIZE];
char *xoutbuf[XBUFSIZE]; char *xoutbuf[XBUFSIZE];
char *axbuf[XBUFSIZE]; char *axbuf[XBUFSIZE];
iv = kzalloc(MAX_IVLEN, GFP_KERNEL);
if (!iv)
return ret;
if (testmgr_alloc_buf(xbuf)) if (testmgr_alloc_buf(xbuf))
goto out_noxbuf; goto out_noxbuf;
if (testmgr_alloc_buf(axbuf)) if (testmgr_alloc_buf(axbuf))
goto out_noaxbuf; goto out_noaxbuf;
if (diff_dst && testmgr_alloc_buf(xoutbuf)) if (diff_dst && testmgr_alloc_buf(xoutbuf))
goto out_nooutbuf; goto out_nooutbuf;
...@@ -767,6 +769,7 @@ static int __test_aead(struct crypto_aead *tfm, int enc, ...@@ -767,6 +769,7 @@ static int __test_aead(struct crypto_aead *tfm, int enc,
out_noaxbuf: out_noaxbuf:
testmgr_free_buf(xbuf); testmgr_free_buf(xbuf);
out_noxbuf: out_noxbuf:
kfree(iv);
return ret; return ret;
} }
......
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