From a0590c556cdbf88373d38494a23f1503d39b0ab2 Mon Sep 17 00:00:00 2001 From: Thorsten Blum Date: Tue, 22 Sep 2026 20:11:02 +0200 Subject: [PATCH] hwrng: intel - return -ENOMEM when kmalloc_obj() fails 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 Signed-off-by: Herbert Xu --- 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 d24e747203c1..4aa91ee0e504 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; }