From: Herbert Xu Date: Tue, 22 Nov 2016 12:08:21 +0000 (+0800) Subject: crypto: api - Do not clear type bits in crypto_larval_lookup X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=430b441cdcdeb7c3eff4c208effb970f41867934;p=linux-beck.git crypto: api - Do not clear type bits in crypto_larval_lookup Currently all bits not set in mask are cleared in crypto_larval_lookup. This is unnecessary as wherever the type bits are used it is always masked anyway. This patch removes the clearing so that we may use bits set in the type but not in the mask for special purposes, e.g., picking up internal algorithms. Signed-off-by: Herbert Xu --- diff --git a/crypto/api.c b/crypto/api.c index a88729ffe4bd..b16ce1653284 100644 --- a/crypto/api.c +++ b/crypto/api.c @@ -211,8 +211,8 @@ struct crypto_alg *crypto_larval_lookup(const char *name, u32 type, u32 mask) if (!name) return ERR_PTR(-ENOENT); + type &= ~(CRYPTO_ALG_LARVAL | CRYPTO_ALG_DEAD); mask &= ~(CRYPTO_ALG_LARVAL | CRYPTO_ALG_DEAD); - type &= mask; alg = crypto_alg_lookup(name, type, mask); if (!alg) {