2009-01-14 06:03:59

by Herbert Xu

[permalink] [raw]
Subject: crypto: shash - Remove superfluous check in init_tfm

Hi:

I'll added this to cryptodev-2.6.

commit 1f4cfc229e0e8c3b48cfada9aecfc72ff438fa61
Author: Herbert Xu <[email protected]>
Date: Wed Jan 14 13:34:48 2009 +1100

crypto: shash - Remove superfluous check in init_tfm

We're currently checking the frontend type in init_tfm. This is
completely pointless because the fact that we're called at all
means that the frontend is ours so the type must match as well.

Signed-off-by: Herbert Xu <[email protected]>

diff --git a/crypto/shash.c b/crypto/shash.c
index c9df367..b96b6e5 100644
--- a/crypto/shash.c
+++ b/crypto/shash.c
@@ -437,8 +437,6 @@ static unsigned int crypto_shash_ctxsize(struct crypto_alg *alg, u32 type,
static int crypto_shash_init_tfm(struct crypto_tfm *tfm,
const struct crypto_type *frontend)
{
- if (frontend->type != CRYPTO_ALG_TYPE_SHASH)
- return -EINVAL;
return 0;
}

Cheres,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt