hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/crypto/drbg.c
....@@ -1516,6 +1516,14 @@
15161516 return 0;
15171517
15181518 drbg->jent = crypto_alloc_rng("jitterentropy_rng", 0, 0);
1519
+ if (IS_ERR(drbg->jent)) {
1520
+ const int err = PTR_ERR(drbg->jent);
1521
+
1522
+ drbg->jent = NULL;
1523
+ if (fips_enabled)
1524
+ return err;
1525
+ pr_info("DRBG: Continuing without Jitter RNG\n");
1526
+ }
15191527
15201528 return 0;
15211529 }
....@@ -1570,14 +1578,6 @@
15701578 ret = drbg_prepare_hrng(drbg);
15711579 if (ret)
15721580 goto free_everything;
1573
-
1574
- if (IS_ERR(drbg->jent)) {
1575
- ret = PTR_ERR(drbg->jent);
1576
- drbg->jent = NULL;
1577
- if (fips_enabled || ret != -ENOENT)
1578
- goto free_everything;
1579
- pr_info("DRBG: Continuing without Jitter RNG\n");
1580
- }
15811581
15821582 reseed = false;
15831583 }