@@ -36,7 +36,8 @@ EXPORT_SYMBOL_GPL(crypto_chain);
3636DEFINE_STATIC_KEY_FALSE (__crypto_boot_test_finished );
3737#endif
3838
39- static struct crypto_alg * crypto_larval_wait (struct crypto_alg * alg );
39+ static struct crypto_alg * crypto_larval_wait (struct crypto_alg * alg ,
40+ u32 type , u32 mask );
4041static struct crypto_alg * crypto_alg_lookup (const char * name , u32 type ,
4142 u32 mask );
4243
@@ -145,7 +146,7 @@ static struct crypto_alg *crypto_larval_add(const char *name, u32 type,
145146 if (alg != & larval -> alg ) {
146147 kfree (larval );
147148 if (crypto_is_larval (alg ))
148- alg = crypto_larval_wait (alg );
149+ alg = crypto_larval_wait (alg , type , mask );
149150 }
150151
151152 return alg ;
@@ -197,7 +198,8 @@ static void crypto_start_test(struct crypto_larval *larval)
197198 crypto_schedule_test (larval );
198199}
199200
200- static struct crypto_alg * crypto_larval_wait (struct crypto_alg * alg )
201+ static struct crypto_alg * crypto_larval_wait (struct crypto_alg * alg ,
202+ u32 type , u32 mask )
201203{
202204 struct crypto_larval * larval ;
203205 long time_left ;
@@ -219,12 +221,7 @@ static struct crypto_alg *crypto_larval_wait(struct crypto_alg *alg)
219221 crypto_larval_kill (larval );
220222 alg = ERR_PTR (- ETIMEDOUT );
221223 } else if (!alg ) {
222- u32 type ;
223- u32 mask ;
224-
225224 alg = & larval -> alg ;
226- type = alg -> cra_flags & ~(CRYPTO_ALG_LARVAL | CRYPTO_ALG_DEAD );
227- mask = larval -> mask ;
228225 alg = crypto_alg_lookup (alg -> cra_name , type , mask ) ?:
229226 ERR_PTR (- EAGAIN );
230227 } else if (IS_ERR (alg ))
@@ -304,7 +301,7 @@ static struct crypto_alg *crypto_larval_lookup(const char *name, u32 type,
304301 }
305302
306303 if (!IS_ERR_OR_NULL (alg ) && crypto_is_larval (alg ))
307- alg = crypto_larval_wait (alg );
304+ alg = crypto_larval_wait (alg , type , mask );
308305 else if (alg )
309306 ;
310307 else if (!(mask & CRYPTO_ALG_TESTED ))
@@ -352,7 +349,7 @@ struct crypto_alg *crypto_alg_mod_lookup(const char *name, u32 type, u32 mask)
352349 ok = crypto_probing_notify (CRYPTO_MSG_ALG_REQUEST , larval );
353350
354351 if (ok == NOTIFY_STOP )
355- alg = crypto_larval_wait (larval );
352+ alg = crypto_larval_wait (larval , type , mask );
356353 else {
357354 crypto_mod_put (larval );
358355 alg = ERR_PTR (- ENOENT );
0 commit comments