diff --git a/drivers/crypto/omap-sham.c b/drivers/crypto/omap-sham.c index fd50005fd9428f30f8ad2763096a3a365cc90848..f788319f7ba72bf34f6b5b97b4f0e6efcd44c5bc 100644 --- a/drivers/crypto/omap-sham.c +++ b/drivers/crypto/omap-sham.c @@ -1163,7 +1163,7 @@ static int omap_sham_final(struct ahash_request *req) * If buffersize is less than 240, we use fallback SW encoding, * as using DMA + HW in this case doesn't provide any benefit. */ - if ((ctx->digcnt + ctx->bufcnt) < 240) + if (!ctx->digcnt && ctx->bufcnt < 240) return omap_sham_final_shash(req); else if (ctx->bufcnt) return omap_sham_enqueue(req, OP_FINAL);