aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/api.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/api.c')
-rw-r--r--crypto/api.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/crypto/api.c b/crypto/api.c
index 38a2bc02a98c..fd2545decb28 100644
--- a/crypto/api.c
+++ b/crypto/api.c
@@ -221,7 +221,8 @@ struct crypto_alg *crypto_larval_lookup(const char *name, u32 type, u32 mask)
221 221
222 request_module(name); 222 request_module(name);
223 223
224 if (!((type ^ CRYPTO_ALG_NEED_FALLBACK) & mask) && 224 if (!((type ^ CRYPTO_ALG_NEED_FALLBACK) & mask &
225 CRYPTO_ALG_NEED_FALLBACK) &&
225 snprintf(tmp, sizeof(tmp), "%s-all", name) < sizeof(tmp)) 226 snprintf(tmp, sizeof(tmp), "%s-all", name) < sizeof(tmp))
226 request_module(tmp); 227 request_module(tmp);
227 228
@@ -255,7 +256,7 @@ struct crypto_alg *crypto_alg_mod_lookup(const char *name, u32 type, u32 mask)
255 struct crypto_alg *larval; 256 struct crypto_alg *larval;
256 int ok; 257 int ok;
257 258
258 if (!(mask & CRYPTO_ALG_TESTED)) { 259 if (!((type | mask) & CRYPTO_ALG_TESTED)) {
259 type |= CRYPTO_ALG_TESTED; 260 type |= CRYPTO_ALG_TESTED;
260 mask |= CRYPTO_ALG_TESTED; 261 mask |= CRYPTO_ALG_TESTED;
261 } 262 }
@@ -464,8 +465,8 @@ err:
464} 465}
465EXPORT_SYMBOL_GPL(crypto_alloc_base); 466EXPORT_SYMBOL_GPL(crypto_alloc_base);
466 467
467struct crypto_tfm *crypto_create_tfm(struct crypto_alg *alg, 468void *crypto_create_tfm(struct crypto_alg *alg,
468 const struct crypto_type *frontend) 469 const struct crypto_type *frontend)
469{ 470{
470 char *mem; 471 char *mem;
471 struct crypto_tfm *tfm = NULL; 472 struct crypto_tfm *tfm = NULL;
@@ -499,9 +500,9 @@ out_free_tfm:
499 crypto_shoot_alg(alg); 500 crypto_shoot_alg(alg);
500 kfree(mem); 501 kfree(mem);
501out_err: 502out_err:
502 tfm = ERR_PTR(err); 503 mem = ERR_PTR(err);
503out: 504out:
504 return tfm; 505 return mem;
505} 506}
506EXPORT_SYMBOL_GPL(crypto_create_tfm); 507EXPORT_SYMBOL_GPL(crypto_create_tfm);
507 508
@@ -525,12 +526,11 @@ EXPORT_SYMBOL_GPL(crypto_create_tfm);
525 * 526 *
526 * In case of error the return value is an error pointer. 527 * In case of error the return value is an error pointer.
527 */ 528 */
528struct crypto_tfm *crypto_alloc_tfm(const char *alg_name, 529void *crypto_alloc_tfm(const char *alg_name,
529 const struct crypto_type *frontend, 530 const struct crypto_type *frontend, u32 type, u32 mask)
530 u32 type, u32 mask)
531{ 531{
532 struct crypto_alg *(*lookup)(const char *name, u32 type, u32 mask); 532 struct crypto_alg *(*lookup)(const char *name, u32 type, u32 mask);
533 struct crypto_tfm *tfm; 533 void *tfm;
534 int err; 534 int err;
535 535
536 type &= frontend->maskclear; 536 type &= frontend->maskclear;