Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
[platform/kernel/linux-starfive.git] / arch / arm64 / crypto / sha2-ce-glue.c
index 955c3c2..604a01a 100644 (file)
@@ -57,7 +57,7 @@ static int sha256_ce_finup(struct shash_desc *desc, const u8 *data,
                           unsigned int len, u8 *out)
 {
        struct sha256_ce_state *sctx = shash_desc_ctx(desc);
-       bool finalize = !sctx->sst.count && !(len % SHA256_BLOCK_SIZE);
+       bool finalize = !sctx->sst.count && !(len % SHA256_BLOCK_SIZE) && len;
 
        if (!crypto_simd_usable()) {
                if (len)