* [PATCH 1/2] hwrng: intel - return -ENOMEM when ioremap() fails
@ 2026-09-22 18:11 Thorsten Blum
2026-09-22 18:11 ` [PATCH 2/2] hwrng: intel - return -ENOMEM when kmalloc_obj() fails Thorsten Blum
0 siblings, 1 reply; 2+ messages in thread
From: Thorsten Blum @ 2026-09-22 18:11 UTC (permalink / raw)
To: Olivia Mackall, Herbert Xu, Kees Cook, Michael Buesch,
Andrew Morton, Jan Beulich, Greg Kroah-Hartman, Chris Wright
Cc: Thorsten Blum, linux-crypto, linux-kernel
intel_init_hw_struct() incorrectly returns -EBUSY when ioremap() fails.
Return -ENOMEM instead.
Fixes: 641dd002d207 ("[PATCH] fix Intel RNG detection")
Signed-off-by: Thorsten Blum <blum@kernel.org>
---
drivers/char/hw_random/intel-rng.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/char/hw_random/intel-rng.c b/drivers/char/hw_random/intel-rng.c
index d24e747203c1..a4dd21a9de98 100644
--- a/drivers/char/hw_random/intel-rng.c
+++ b/drivers/char/hw_random/intel-rng.c
@@ -318,8 +318,8 @@ PFX "RNG, try using the 'no_fwh_detect' option.\n";
}
intel_rng_hw->mem = ioremap(INTEL_FWH_ADDR, INTEL_FWH_ADDR_LEN);
- if (intel_rng_hw->mem == NULL)
- return -EBUSY;
+ if (!intel_rng_hw->mem)
+ return -ENOMEM;
return 0;
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH 2/2] hwrng: intel - return -ENOMEM when kmalloc_obj() fails
2026-09-22 18:11 [PATCH 1/2] hwrng: intel - return -ENOMEM when ioremap() fails Thorsten Blum
@ 2026-09-22 18:11 ` Thorsten Blum
0 siblings, 0 replies; 2+ messages in thread
From: Thorsten Blum @ 2026-09-22 18:11 UTC (permalink / raw)
To: Olivia Mackall, Herbert Xu, Kees Cook, Andrew Morton, Prarit Bhargava
Cc: Thorsten Blum, linux-crypto, linux-kernel
intel_rng_mod_init() incorrectly returns -ENODEV when kmalloc_obj()
fails. Return -ENOMEM instead.
Fixes: ee527cd3a20c ("Use stop_machine_run in the Intel RNG driver")
Signed-off-by: Thorsten Blum <blum@kernel.org>
---
drivers/char/hw_random/intel-rng.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/char/hw_random/intel-rng.c b/drivers/char/hw_random/intel-rng.c
index a4dd21a9de98..f7f734881c68 100644
--- a/drivers/char/hw_random/intel-rng.c
+++ b/drivers/char/hw_random/intel-rng.c
@@ -349,6 +349,7 @@ static int __init intel_rng_mod_init(void)
intel_rng_hw = kmalloc_obj(*intel_rng_hw);
if (!intel_rng_hw) {
pci_dev_put(dev);
+ err = -ENOMEM;
goto out;
}
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-09-22 18:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-22 18:11 [PATCH 1/2] hwrng: intel - return -ENOMEM when ioremap() fails Thorsten Blum
2026-09-22 18:11 ` [PATCH 2/2] hwrng: intel - return -ENOMEM when kmalloc_obj() fails Thorsten Blum
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®