From dfcf0caa49ef53bf73267296e5ee764175249770 Mon Sep 17 00:00:00 2001 From: Russell King Date: Sun, 18 Oct 2015 17:51:25 +0100 Subject: [PATCH] MLK-12312: CAAM hash algorithms fail registration during initialization Fix cherry-picked from 5ec908319ab53072d3a2188e62ed2e5d7b846951 crypto: caam - only export the state we really need to export Avoid exporting lots of state by only exporting what we really require, which is the buffer containing the set of pending bytes to be hashed, number of pending bytes, the context buffer, and the function pointer state. This reduces down the exported state size to 216 bytes from 576 bytes. Signed-off-by: Russell King Signed-off-by: Herbert Xu --- drivers/crypto/caam/caamhash.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/caam/caamhash.c b/drivers/crypto/caam/caamhash.c index b005a65c8013..384e4cf257be 100644 --- a/drivers/crypto/caam/caamhash.c +++ b/drivers/crypto/caam/caamhash.c @@ -1929,8 +1929,9 @@ static struct caam_hash_template driver_hash[] = { .setkey = axcbc_setkey, .halg = { .digestsize = XCBC_MAC_DIGEST_SIZE, - }, + .statesize = sizeof(struct caam_export_state), }, + }, .alg_type = OP_ALG_ALGSEL_AES | OP_ALG_AAI_XCBC_MAC, }, };