File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1231,15 +1231,11 @@ static int wc_linuxkm_drbg_generate(struct wc_rng_bank *ctx,
12311231 continue ;
12321232
12331233 if (unlikely (ret == WC_NO_ERR_TRACE (RNG_FAILURE_E ))) {
1234- if (slen > 0 ) {
1235- ret = - EINVAL ;
1234+ if (slen > 0 )
12361235 break ;
1237- }
12381236
1239- if (retried ) {
1240- ret = - EINVAL ;
1237+ if (retried )
12411238 break ;
1242- }
12431239 retried = 1 ;
12441240
12451241 ret = wc_rng_bank_inst_reinit (ctx ,
@@ -1248,20 +1244,19 @@ static int wc_linuxkm_drbg_generate(struct wc_rng_bank *ctx,
12481244 WC_RNG_BANK_FLAG_CAN_WAIT );
12491245
12501246 if (ret == 0 ) {
1251- pr_warn ("WARNING: reinitialized DRBG #%d after RNG_FAILURE_E from wc_RNG_GenerateBlock().\n" , raw_smp_processor_id ());
1247+ pr_warn_ratelimited ("WARNING: reinitialized DRBG #%d after RNG_FAILURE_E from wc_RNG_GenerateBlock().\n" , raw_smp_processor_id ());
12521248 continue ;
12531249 }
12541250 else {
1255- pr_warn_once ("ERROR: reinitialization of DRBG #%d after RNG_FAILURE_E failed with ret %d.\n" , raw_smp_processor_id (), ret );
1256- ret = - EINVAL ;
1251+ pr_err_ratelimited ("ERROR: reinitialization of DRBG #%d after RNG_FAILURE_E failed with ret %d.\n" , raw_smp_processor_id (), ret );
12571252 break ;
12581253 }
12591254 }
1260- else {
1261- pr_warn_once ( "ERROR: wc_linuxkm_drbg_generate() wc_RNG_GenerateBlock returned %d.\n" , ret );
1262- ret = - EINVAL ;
1263- break ;
1264- }
1255+ }
1256+
1257+ if ( ret != 0 ) {
1258+ pr_err_ratelimited ( "ERROR: wc_linuxkm_drbg_generate() failing on wolfCrypt code %d.\n" , ret ) ;
1259+ ret = - EINVAL ;
12651260 }
12661261
12671262out :
You can’t perform that action at this time.
0 commit comments