From: Rui Wang <rui.y.wang@intel.com>
To: herbert@gondor.apana.org.au
Cc: ying.huang@intel.com, linux-crypto@vger.kernel.org,
linux-kernel@vger.kernel.org, rui.y.wang@intel.com
Subject: [PATCH 2/2] crypto: cryptd - Assign statesize properly
Date: Sun, 29 Nov 2015 22:45:34 +0800 [thread overview]
Message-ID: <1448808334-8424-3-git-send-email-rui.y.wang@intel.com> (raw)
In-Reply-To: <1448808334-8424-1-git-send-email-rui.y.wang@intel.com>
cryptd_create_hash() fails by returning -EINVAL. It is because after
8996eafdc ("crypto: ahash - ensure statesize is non-zero") all ahash
drivers must have a non-zero statesize.
This patch fixes the problem by properly assigning the statesize.
Signed-off-by: Rui Wang <rui.y.wang@intel.com>
---
crypto/cryptd.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/crypto/cryptd.c b/crypto/cryptd.c
index c81861b..8b40db8 100644
--- a/crypto/cryptd.c
+++ b/crypto/cryptd.c
@@ -637,6 +637,7 @@ static int cryptd_create_hash(struct crypto_template *tmpl, struct rtattr **tb,
inst->alg.halg.base.cra_flags = type;
inst->alg.halg.digestsize = salg->digestsize;
+ inst->alg.halg.statesize = salg->statesize;
inst->alg.halg.base.cra_ctxsize = sizeof(struct cryptd_hash_ctx);
inst->alg.halg.base.cra_init = cryptd_hash_init_tfm;
--
1.8.5.2
next prev parent reply other threads:[~2015-11-29 15:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-29 14:45 [PATCH 0/2] crypto: Fix driver load failure Rui Wang
2015-11-29 14:45 ` [PATCH 1/2] crypto: ghash-clmulni - Fix " Rui Wang
2015-11-29 14:45 ` Rui Wang [this message]
2015-12-04 14:41 ` [PATCH 0/2] crypto: Fix driver " Herbert Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1448808334-8424-3-git-send-email-rui.y.wang@intel.com \
--to=rui.y.wang@intel.com \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ying.huang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®