2015-11-30 13:18:35

by Fabio Estevam

[permalink] [raw]
Subject: [PATCH] crypto: caam - pass the correct buffer length

When buffer 0 is used we should use buflen_0 instead of buflen_1.

Fix it.

Signed-off-by: Fabio Estevam <[email protected]>
---
Untested.

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

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);
--
1.9.1


2015-12-04 14:41:42

by Herbert Xu

[permalink] [raw]
Subject: Re: [PATCH] crypto: caam - pass the correct buffer length

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 <[email protected]>

Patch applied. Thanks.
--
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt