summaryrefslogtreecommitdiffstats
path: root/ipmi-fixes.patch
diff options
context:
space:
mode:
authorJeremy Cline <jeremy@jcline.org>2018-04-19 10:13:19 -0400
committerJeremy Cline <jeremy@jcline.org>2018-04-19 13:08:25 -0400
commit280956f686d89ca774e133c223f68cfe1102c626 (patch)
tree74169c090d2fd6c65bd1b44c3bbefc919270d941 /ipmi-fixes.patch
parent8d319f1cc82ea096bd37daaab847e0ec63f9ed56 (diff)
downloadkernel-280956f686d89ca774e133c223f68cfe1102c626.tar.gz
kernel-280956f686d89ca774e133c223f68cfe1102c626.tar.xz
kernel-280956f686d89ca774e133c223f68cfe1102c626.zip
Linux v4.16.3
Diffstat (limited to 'ipmi-fixes.patch')
-rw-r--r--ipmi-fixes.patch86
1 files changed, 0 insertions, 86 deletions
diff --git a/ipmi-fixes.patch b/ipmi-fixes.patch
index b1838efa0..04cfb8628 100644
--- a/ipmi-fixes.patch
+++ b/ipmi-fixes.patch
@@ -2372,89 +2372,3 @@ index 17f349459587..c2b23a9fdf3d 100644
--
2.14.3
-
-From 426fa6179dae677134dfb37b21d057819418515b Mon Sep 17 00:00:00 2001
-From: Corey Minyard <cminyard@mvista.com>
-Date: Wed, 28 Feb 2018 08:09:49 -0600
-Subject: [PATCH 9/9] ipmi: Fix some error cleanup issues
-
-device_remove_group() was called on any cleanup, even if the
-device attrs had not been added yet. That can occur in certain
-error scenarios, so add a flag to know if it has been added.
-
-Also make sure we remove the dev if we added it ourselves.
-
-Signed-off-by: Corey Minyard <cminyard@mvista.com>
-Cc: stable@vger.kernel.org # 4.15
----
- drivers/char/ipmi/ipmi_si_intf.c | 18 ++++++++++++++----
- 1 file changed, 14 insertions(+), 4 deletions(-)
-
-diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
-index 5141ccf0b958..2b9f434775d4 100644
---- a/drivers/char/ipmi/ipmi_si_intf.c
-+++ b/drivers/char/ipmi/ipmi_si_intf.c
-@@ -232,6 +232,9 @@ struct smi_info {
- /* Default driver model device. */
- struct platform_device *pdev;
-
-+ /* Have we added the device group to the device? */
-+ bool dev_group_added;
-+
- /* Counters and things for the proc filesystem. */
- atomic_t stats[SI_NUM_STATS];
-
-@@ -2007,8 +2010,8 @@ int ipmi_si_add_smi(struct si_sm_io *io)
- if (initialized) {
- rv = try_smi_init(new_smi);
- if (rv) {
-- mutex_unlock(&smi_infos_lock);
- cleanup_one_si(new_smi);
-+ mutex_unlock(&smi_infos_lock);
- return rv;
- }
- }
-@@ -2167,6 +2170,7 @@ static int try_smi_init(struct smi_info *new_smi)
- rv);
- goto out_err_stop_timer;
- }
-+ new_smi->dev_group_added = true;
-
- rv = ipmi_register_smi(&handlers,
- new_smi,
-@@ -2220,7 +2224,10 @@ static int try_smi_init(struct smi_info *new_smi)
- return 0;
-
- out_err_remove_attrs:
-- device_remove_group(new_smi->io.dev, &ipmi_si_dev_attr_group);
-+ if (new_smi->dev_group_added) {
-+ device_remove_group(new_smi->io.dev, &ipmi_si_dev_attr_group);
-+ new_smi->dev_group_added = false;
-+ }
- dev_set_drvdata(new_smi->io.dev, NULL);
-
- out_err_stop_timer:
-@@ -2268,6 +2275,7 @@ static int try_smi_init(struct smi_info *new_smi)
- else
- platform_device_put(new_smi->pdev);
- new_smi->pdev = NULL;
-+ new_smi->io.dev = NULL;
- }
-
- kfree(init_name);
-@@ -2364,8 +2372,10 @@ static void cleanup_one_si(struct smi_info *to_clean)
- }
- }
-
-- device_remove_group(to_clean->io.dev, &ipmi_si_dev_attr_group);
-- dev_set_drvdata(to_clean->io.dev, NULL);
-+ if (to_clean->dev_group_added)
-+ device_remove_group(to_clean->io.dev, &ipmi_si_dev_attr_group);
-+ if (to_clean->io.dev)
-+ dev_set_drvdata(to_clean->io.dev, NULL);
-
- list_del(&to_clean->link);
-
---
-2.14.3
-