diff mbox

[v2,2/4] crypto: mcryptd - Fix load failure

Message ID 1453885718-24599-3-git-send-email-rui.y.wang@intel.com (mailing list archive)
State Accepted
Delegated to: Herbert Xu
Headers show

Commit Message

Wang, Rui Y Jan. 27, 2016, 9:08 a.m. UTC
mcryptd_create_hash() fails by returning -EINVAL, causing any
driver using mcryptd to fail to load. It is because it needs
to set its statesize properly.

Signed-off-by: Rui Wang <rui.y.wang@intel.com>
---
 crypto/mcryptd.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Herbert Xu Feb. 1, 2016, 8:16 a.m. UTC | #1
On Wed, Jan 27, 2016 at 05:08:36PM +0800, Rui Wang wrote:
> mcryptd_create_hash() fails by returning -EINVAL, causing any
> driver using mcryptd to fail to load. It is because it needs
> to set its statesize properly.
> 
> Signed-off-by: Rui Wang <rui.y.wang@intel.com>

Applied.
diff mbox

Patch

diff --git a/crypto/mcryptd.c b/crypto/mcryptd.c
index f78d4fc..c4eb9da 100644
--- a/crypto/mcryptd.c
+++ b/crypto/mcryptd.c
@@ -522,6 +522,7 @@  static int mcryptd_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 mcryptd_hash_ctx);
 
 	inst->alg.halg.base.cra_init = mcryptd_hash_init_tfm;