Skip to content

Commit

Permalink
crypto: testmgr - Fix DMA-API warning
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tadeusz Struk authored and Herbert Xu committed May 22, 2014
1 parent 51a7163 commit 9bac019
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions crypto/testmgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,16 +414,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;

Expand Down Expand Up @@ -767,6 +769,7 @@ static int __test_aead(struct crypto_aead *tfm, int enc,
out_noaxbuf:
testmgr_free_buf(xbuf);
out_noxbuf:
kfree(iv);
return ret;
}

Expand Down

0 comments on commit 9bac019

Please sign in to comment.