From: Will Thomas Date: Fri, 5 Aug 2016 13:00:20 +0000 (+0100) Subject: crypto: img-hash - Fix set_reqsize call X-Git-Tag: v4.9-rc1~53^2~115 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=5e38d20088d48b60775bdbdfdf47f8a2c4f6288f;p=karo-tx-linux.git crypto: img-hash - Fix set_reqsize call Properly allocate enough memory to respect the fallback. Signed-off-by: Will Thomas Signed-off-by: Herbert Xu --- 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;