summaryrefslogtreecommitdiff
path: root/drivers/crypto/img-hash.c
diff options
context:
space:
mode:
authorWill Thomas <will.thomas@imgtec.com>2016-08-05 16:00:20 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2016-08-09 13:47:23 +0300
commit5e38d20088d48b60775bdbdfdf47f8a2c4f6288f (patch)
tree1977ac7c021f350810fdb66b2df126e387a21cea /drivers/crypto/img-hash.c
parentfb67740e2fb82c97cca6df24882df4e7c898aae4 (diff)
downloadlinux-5e38d20088d48b60775bdbdfdf47f8a2c4f6288f.tar.xz
crypto: img-hash - Fix set_reqsize call
Properly allocate enough memory to respect the fallback. Signed-off-by: Will Thomas <will.thomas@imgtec.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/img-hash.c')
-rw-r--r--drivers/crypto/img-hash.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/crypto/img-hash.c b/drivers/crypto/img-hash.c
index 60410d79bbc5..a2e77b87485b 100644
--- a/drivers/crypto/img-hash.c
+++ b/drivers/crypto/img-hash.c
@@ -686,6 +686,7 @@ static int img_hash_cra_init(struct crypto_tfm *tfm, const char *alg_name)
}
crypto_ahash_set_reqsize(__crypto_ahash_cast(tfm),
sizeof(struct img_hash_request_ctx) +
+ crypto_ahash_reqsize(ctx->fallback) +
IMG_HASH_DMA_THRESHOLD);
return 0;