crypto: caam - pass the correct buffer length
authorFabio Estevam <fabio.estevam@freescale.com>
Mon, 30 Nov 2015 13:03:58 +0000 (11:03 -0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 4 Dec 2015 14:29:56 +0000 (22:29 +0800)
When buffer 0 is used we should use buflen_0 instead of buflen_1.

Fix it.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/caam/caamhash.c

index fe9c156333cadeb240df02b6141396254be48be7..5845d4a0879727dc3144a6be3b871c8d8d6918b1 100644 (file)
@@ -1596,7 +1596,7 @@ static int ahash_export(struct ahash_request *req, void *out)
                len = state->buflen_1;
        } else {
                buf = state->buf_0;
-               len = state->buflen_1;
+               len = state->buflen_0;
        }
 
        memcpy(export->buf, buf, len);