]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
crypto: img-hash - Fix set_reqsize call
authorWill Thomas <will.thomas@imgtec.com>
Fri, 5 Aug 2016 13:00:20 +0000 (14:00 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Tue, 9 Aug 2016 10:47:23 +0000 (18:47 +0800)
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>
drivers/crypto/img-hash.c

index 60410d79bbc574912742acdc20b4c213412e964a..a2e77b87485bea56ae00ba9df51d06eafae315a7 100644 (file)
@@ -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;