[3/8] crypto: inside-secure - fix the extra cache computation
diff mbox

Message ID 20180213082657.4759-4-antoine.tenart@bootlin.com
State Accepted
Delegated to: Herbert Xu
Headers show

Commit Message

Antoine Tenart Feb. 13, 2018, 8:26 a.m. UTC
This patch fixes the extra cache computation when the queued data is a
multiple of a block size. This fixes the hash support in some cases.

Fixes: 809778e02cd4 ("crypto: inside-secure - fix hash when length is a multiple of a block")
Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
 drivers/crypto/inside-secure/safexcel_hash.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff mbox

diff --git a/drivers/crypto/inside-secure/safexcel_hash.c b/drivers/crypto/inside-secure/safexcel_hash.c
index 122a2a58e98f..8fac23b78da5 100644
--- a/drivers/crypto/inside-secure/safexcel_hash.c
+++ b/drivers/crypto/inside-secure/safexcel_hash.c
@@ -198,7 +198,7 @@  static int safexcel_ahash_send_req(struct crypto_async_request *async, int ring,
 			/* If this is not the last request and the queued data
 			 * is a multiple of a block, cache the last one for now.
-			extra = queued - crypto_ahash_blocksize(ahash);
+			extra = crypto_ahash_blocksize(ahash);
 		if (extra) {
 			sg_pcopy_to_buffer(areq->src, sg_nents(areq->src),