[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211217154410.1228673-1-cascardo@canonical.com>
Date: Fri, 17 Dec 2021 12:44:09 -0300
From: Thadeu Lima de Souza Cascardo <cascardo@...onical.com>
To: openipmi-developer@...ts.sourceforge.net
Cc: linux-kernel@...r.kernel.org, minyard@....org,
ioanna-maria.alifieraki@...onical.com, minyard@...sta.com,
stable@...r.kernel.org
Subject: [PATCH 1/2] ipmi: bail out if init_srcu_struct fails
In case, init_srcu_struct fails (because of memory allocation failure), we
might proceed with the driver initialization despite srcu_struct not being
entirely initialized.
Fixes: 913a89f009d9 ("ipmi: Don't initialize anything in the core until something uses it")
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@...onical.com>
Cc: Corey Minyard <cminyard@...sta.com>
Cc: stable@...r.kernel.org
---
drivers/char/ipmi/ipmi_msghandler.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c
index c837d5416e0e..84975b21fff2 100644
--- a/drivers/char/ipmi/ipmi_msghandler.c
+++ b/drivers/char/ipmi/ipmi_msghandler.c
@@ -5392,7 +5392,9 @@ static int ipmi_init_msghandler(void)
if (initialized)
goto out;
- init_srcu_struct(&ipmi_interfaces_srcu);
+ rv = init_srcu_struct(&ipmi_interfaces_srcu);
+ if (rv)
+ goto out;
timer_setup(&ipmi_timer, ipmi_timeout, 0);
mod_timer(&ipmi_timer, jiffies + IPMI_TIMEOUT_JIFFIES);
--
2.32.0
Powered by blists - more mailing lists