summaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
authorVictoria Milhoan <vicki.milhoan@freescale.com>2014-11-05 05:13:05 -0700
committerNitin Garg <nitin.garg@freescale.com>2015-09-17 09:20:52 -0500
commit71d484d9bea9bb6c36287b2dc4f9db09a4138bc7 (patch)
tree1fccaa4a4806ee347aeface0e4ea577029694cb5 /crypto
parent5b825944d29e472044983070914a9adb13be9b99 (diff)
MLK-9710-8 tcrypt: change memory allocation for test_ahash_speed output buffer
Change allocation of the tcrypt module's test_ahash_speed() output buffer to use kmalloc(). This avoids a segmentation fault when the buffer is used in a dma_map_*() call. Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com> (cherry picked from commit 3c8c56d1bd82433af6a565d183bdb632fd01a13a)
Diffstat (limited to 'crypto')
-rw-r--r--crypto/tcrypt.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c
index 0d9003ae8c61..94d2a3b59881 100644
--- a/crypto/tcrypt.c
+++ b/crypto/tcrypt.c
@@ -917,7 +917,8 @@ static void test_ahash_speed(const char *algo, unsigned int sec,
struct tcrypt_result tresult;
struct ahash_request *req;
struct crypto_ahash *tfm;
- static char output[1024];
+ const int output_size = 1024;
+ char *output = kmalloc(output_size, GFP_KERNEL);
int i, ret;
printk(KERN_INFO "\ntesting speed of async %s\n", algo);
@@ -929,9 +930,9 @@ static void test_ahash_speed(const char *algo, unsigned int sec,
return;
}
- if (crypto_ahash_digestsize(tfm) > sizeof(output)) {
+ if (crypto_ahash_digestsize(tfm) > output_size) {
pr_err("digestsize(%u) > outputbuffer(%zu)\n",
- crypto_ahash_digestsize(tfm), sizeof(output));
+ crypto_ahash_digestsize(tfm), output_size);
goto out;
}