From 12dcee0e3cc22d4e0c6b380963dc9527cd558e7e Mon Sep 17 00:00:00 2001 From: Tadeusz Struk Date: Mon, 19 May 2014 09:51:33 -0700 Subject: 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 Signed-off-by: Herbert Xu (cherry picked from commit 9bac019dad8098a77cce555d929f678e22111783) Change-Id: I709ed7e293287b840abb25de21cbe4b1732e8402 Reviewed-on: http://git.am.freescale.net:8181/17737 Tested-by: Review Code-CDREVIEW Reviewed-by: Ruchika Gupta Reviewed-by: Zhengxiong Jin Tested-by: Zhengxiong Jin diff --git a/crypto/testmgr.c b/crypto/testmgr.c index 117b312..71e61ac 100644 --- a/crypto/testmgr.c +++ b/crypto/testmgr.c @@ -422,16 +422,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; @@ -775,6 +777,7 @@ out_nooutbuf: out_noaxbuf: testmgr_free_buf(xbuf); out_noxbuf: + kfree(iv); return ret; } -- cgit v0.10.2