diff mbox

crypto: caam - pass the correct buffer length

Message ID 1448888638-7921-1-git-send-email-fabio.estevam@freescale.com (mailing list archive)
State Accepted
Delegated to: Herbert Xu
Headers show

Commit Message

Fabio Estevam Nov. 30, 2015, 1:03 p.m. UTC
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>
---
Untested.

 drivers/crypto/caam/caamhash.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Herbert Xu Dec. 4, 2015, 2:41 p.m. UTC | #1
On Mon, Nov 30, 2015 at 11:03:58AM -0200, Fabio Estevam wrote:
> 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>

Patch applied.  Thanks.
diff mbox

Patch

diff --git a/drivers/crypto/caam/caamhash.c b/drivers/crypto/caam/caamhash.c
index fe9c156..5845d4a 100644
--- a/drivers/crypto/caam/caamhash.c
+++ b/drivers/crypto/caam/caamhash.c
@@ -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);