linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] platform/x86: think-lmi: Fix resource cleanup flaws
@ 2025-06-28  5:00 Kurt Borja
  2025-06-28  5:00 ` [PATCH 1/3] platform/x86: think-lmi: Create ksets consecutively Kurt Borja
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Kurt Borja @ 2025-06-28  5:00 UTC (permalink / raw)
  To: Mark Pearson, Hans de Goede, Ilpo Järvinen
  Cc: platform-driver-x86, linux-kernel, Kurt Borja

Hi all,

First patch is a prerequisite in order to avoid NULL pointer
dereferences in error paths. Then two fixes follow.

Signed-off-by: Kurt Borja <kuurtb@gmail.com>
---
Kurt Borja (3):
      platform/x86: think-lmi: Create ksets consecutively
      platform/x86: think-lmi: Fix kobject cleanup
      platform/x86: think-lmi: Fix sysfs group cleanup

 drivers/platform/x86/lenovo/think-lmi.c | 92 ++++++++++++---------------------
 1 file changed, 33 insertions(+), 59 deletions(-)
---
base-commit: 73f0f2b52c5ea67b3140b23f58d8079d158839c8
change-id: 20250628-lmi-fix-98143b10d9fd
-- 
 ~ Kurt


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/3] platform/x86: think-lmi: Create ksets consecutively
  2025-06-28  5:00 [PATCH 0/3] platform/x86: think-lmi: Fix resource cleanup flaws Kurt Borja
@ 2025-06-28  5:00 ` Kurt Borja
  2025-06-28  5:00 ` [PATCH 2/3] platform/x86: think-lmi: Fix kobject cleanup Kurt Borja
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Kurt Borja @ 2025-06-28  5:00 UTC (permalink / raw)
  To: Mark Pearson, Hans de Goede, Ilpo Järvinen
  Cc: platform-driver-x86, linux-kernel, Kurt Borja

Avoid entering tlmi_release_attr() in error paths if both ksets are not
yet created.

This is accomplished by initializing them side by side.

Signed-off-by: Kurt Borja <kuurtb@gmail.com>
---
 drivers/platform/x86/lenovo/think-lmi.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/platform/x86/lenovo/think-lmi.c b/drivers/platform/x86/lenovo/think-lmi.c
index 34a47269e3d34d2eda6b71af73892656cd2bf67d..b3e7d76cccf7840a5bcf7f849f2a70e164cb7086 100644
--- a/drivers/platform/x86/lenovo/think-lmi.c
+++ b/drivers/platform/x86/lenovo/think-lmi.c
@@ -1457,6 +1457,14 @@ static int tlmi_sysfs_init(void)
 		goto fail_device_created;
 	}
 
+	tlmi_priv.authentication_kset = kset_create_and_add("authentication", NULL,
+							    &tlmi_priv.class_dev->kobj);
+	if (!tlmi_priv.authentication_kset) {
+		kset_unregister(tlmi_priv.attribute_kset);
+		ret = -ENOMEM;
+		goto fail_device_created;
+	}
+
 	for (i = 0; i < TLMI_SETTINGS_COUNT; i++) {
 		/* Check if index is a valid setting - skip if it isn't */
 		if (!tlmi_priv.setting[i])
@@ -1498,12 +1506,6 @@ static int tlmi_sysfs_init(void)
 	}
 
 	/* Create authentication entries */
-	tlmi_priv.authentication_kset = kset_create_and_add("authentication", NULL,
-								&tlmi_priv.class_dev->kobj);
-	if (!tlmi_priv.authentication_kset) {
-		ret = -ENOMEM;
-		goto fail_create_attr;
-	}
 	tlmi_priv.pwd_admin->kobj.kset = tlmi_priv.authentication_kset;
 	ret = kobject_add(&tlmi_priv.pwd_admin->kobj, NULL, "%s", "Admin");
 	if (ret)

-- 
2.50.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/3] platform/x86: think-lmi: Fix kobject cleanup
  2025-06-28  5:00 [PATCH 0/3] platform/x86: think-lmi: Fix resource cleanup flaws Kurt Borja
  2025-06-28  5:00 ` [PATCH 1/3] platform/x86: think-lmi: Create ksets consecutively Kurt Borja
@ 2025-06-28  5:00 ` Kurt Borja
  2025-06-28  5:32   ` Kurt Borja
  2025-06-28  5:00 ` [PATCH 3/3] platform/x86: think-lmi: Fix sysfs group cleanup Kurt Borja
  2025-06-28 19:30 ` [PATCH 0/3] platform/x86: think-lmi: Fix resource cleanup flaws Mark Pearson
  3 siblings, 1 reply; 7+ messages in thread
From: Kurt Borja @ 2025-06-28  5:00 UTC (permalink / raw)
  To: Mark Pearson, Hans de Goede, Ilpo Järvinen
  Cc: platform-driver-x86, linux-kernel, Kurt Borja

Cleanup of allocated kobjects has many flaws.

In tlmi_analyze(), allocated structs with an embedded kobject are freed
in error paths after the they were already initialized.

In tlmi_release_attr(), which is called in tlmi_sysfs_init() error paths
and in module exit, kobject_del() is never called. This, between other
things, leaks the reference of the parent kobject, which is a kset in
this case.

Fix this flaws simultaneously, first by avoiding the initialization of
kobjects in tlmi_analyze() and then by correctly cleaning them up in
tlmi_release_attr() using their kset's kobject list.

Fixes: a40cd7ef22fb ("platform/x86: think-lmi: Add WMI interface support on Lenovo platforms")
Signed-off-by: Kurt Borja <kuurtb@gmail.com>
---
 drivers/platform/x86/lenovo/think-lmi.c | 39 +++++++++++++++++++--------------
 1 file changed, 23 insertions(+), 16 deletions(-)

diff --git a/drivers/platform/x86/lenovo/think-lmi.c b/drivers/platform/x86/lenovo/think-lmi.c
index b3e7d76cccf7840a5bcf7f849f2a70e164cb7086..da3568727d79832f4669d7217e2fdf691acf1cf5 100644
--- a/drivers/platform/x86/lenovo/think-lmi.c
+++ b/drivers/platform/x86/lenovo/think-lmi.c
@@ -1382,13 +1382,13 @@ static struct kobj_attribute debug_cmd = __ATTR_WO(debug_cmd);
 /* ---- Initialisation --------------------------------------------------------- */
 static void tlmi_release_attr(void)
 {
+	struct kobject *pos, *n;
 	int i;
 
 	/* Attribute structures */
 	for (i = 0; i < TLMI_SETTINGS_COUNT; i++) {
 		if (tlmi_priv.setting[i]) {
 			sysfs_remove_group(&tlmi_priv.setting[i]->kobj, &tlmi_attr_group);
-			kobject_put(&tlmi_priv.setting[i]->kobj);
 		}
 	}
 	sysfs_remove_file(&tlmi_priv.attribute_kset->kobj, &pending_reboot.attr);
@@ -1397,6 +1397,11 @@ static void tlmi_release_attr(void)
 	if (tlmi_priv.can_debug_cmd && debug_support)
 		sysfs_remove_file(&tlmi_priv.attribute_kset->kobj, &debug_cmd.attr);
 
+	list_for_each_entry_safe(pos, n, &tlmi_priv.attribute_kset->list, entry) {
+		kobject_del(pos);
+		kobject_put(pos);
+	}
+
 	kset_unregister(tlmi_priv.attribute_kset);
 
 	/* Free up any saved signatures */
@@ -1405,17 +1410,17 @@ static void tlmi_release_attr(void)
 
 	/* Authentication structures */
 	sysfs_remove_group(&tlmi_priv.pwd_admin->kobj, &auth_attr_group);
-	kobject_put(&tlmi_priv.pwd_admin->kobj);
 	sysfs_remove_group(&tlmi_priv.pwd_power->kobj, &auth_attr_group);
-	kobject_put(&tlmi_priv.pwd_power->kobj);
 
 	if (tlmi_priv.opcode_support) {
 		sysfs_remove_group(&tlmi_priv.pwd_system->kobj, &auth_attr_group);
-		kobject_put(&tlmi_priv.pwd_system->kobj);
 		sysfs_remove_group(&tlmi_priv.pwd_hdd->kobj, &auth_attr_group);
-		kobject_put(&tlmi_priv.pwd_hdd->kobj);
 		sysfs_remove_group(&tlmi_priv.pwd_nvme->kobj, &auth_attr_group);
-		kobject_put(&tlmi_priv.pwd_nvme->kobj);
+	}
+
+	list_for_each_entry_safe(pos, n, &tlmi_priv.authentication_kset->list, entry) {
+		kobject_del(pos);
+		kobject_put(pos);
 	}
 
 	kset_unregister(tlmi_priv.authentication_kset);
@@ -1481,8 +1486,8 @@ static int tlmi_sysfs_init(void)
 
 		/* Build attribute */
 		tlmi_priv.setting[i]->kobj.kset = tlmi_priv.attribute_kset;
-		ret = kobject_add(&tlmi_priv.setting[i]->kobj, NULL,
-				  "%s", tlmi_priv.setting[i]->display_name);
+		ret = kobject_init_and_add(&tlmi_priv.setting[i]->kobj, &tlmi_attr_setting_ktype,
+					   NULL, "%s", tlmi_priv.setting[i]->display_name);
 		if (ret)
 			goto fail_create_attr;
 
@@ -1507,7 +1512,8 @@ static int tlmi_sysfs_init(void)
 
 	/* Create authentication entries */
 	tlmi_priv.pwd_admin->kobj.kset = tlmi_priv.authentication_kset;
-	ret = kobject_add(&tlmi_priv.pwd_admin->kobj, NULL, "%s", "Admin");
+	ret = kobject_init_and_add(&tlmi_priv.pwd_admin->kobj, &tlmi_pwd_setting_ktype,
+				   NULL, "%s", "Admin");
 	if (ret)
 		goto fail_create_attr;
 
@@ -1516,7 +1522,8 @@ static int tlmi_sysfs_init(void)
 		goto fail_create_attr;
 
 	tlmi_priv.pwd_power->kobj.kset = tlmi_priv.authentication_kset;
-	ret = kobject_add(&tlmi_priv.pwd_power->kobj, NULL, "%s", "Power-on");
+	ret = kobject_init_and_add(&tlmi_priv.pwd_power->kobj, &tlmi_pwd_setting_ktype,
+				   NULL, "%s", "Power-on");
 	if (ret)
 		goto fail_create_attr;
 
@@ -1526,7 +1533,8 @@ static int tlmi_sysfs_init(void)
 
 	if (tlmi_priv.opcode_support) {
 		tlmi_priv.pwd_system->kobj.kset = tlmi_priv.authentication_kset;
-		ret = kobject_add(&tlmi_priv.pwd_system->kobj, NULL, "%s", "System");
+		ret = kobject_init_and_add(&tlmi_priv.pwd_system->kobj, &tlmi_pwd_setting_ktype,
+					   NULL, "%s", "System");
 		if (ret)
 			goto fail_create_attr;
 
@@ -1535,7 +1543,8 @@ static int tlmi_sysfs_init(void)
 			goto fail_create_attr;
 
 		tlmi_priv.pwd_hdd->kobj.kset = tlmi_priv.authentication_kset;
-		ret = kobject_add(&tlmi_priv.pwd_hdd->kobj, NULL, "%s", "HDD");
+		ret = kobject_init_and_add(&tlmi_priv.pwd_hdd->kobj, &tlmi_pwd_setting_ktype,
+					   NULL, "%s", "HDD");
 		if (ret)
 			goto fail_create_attr;
 
@@ -1544,7 +1553,8 @@ static int tlmi_sysfs_init(void)
 			goto fail_create_attr;
 
 		tlmi_priv.pwd_nvme->kobj.kset = tlmi_priv.authentication_kset;
-		ret = kobject_add(&tlmi_priv.pwd_nvme->kobj, NULL, "%s", "NVMe");
+		ret = kobject_init_and_add(&tlmi_priv.pwd_nvme->kobj, &tlmi_pwd_setting_ktype,
+					   NULL, "%s", "NVMe");
 		if (ret)
 			goto fail_create_attr;
 
@@ -1581,8 +1591,6 @@ static struct tlmi_pwd_setting *tlmi_create_auth(const char *pwd_type,
 	new_pwd->maxlen = tlmi_priv.pwdcfg.core.max_length;
 	new_pwd->index = 0;
 
-	kobject_init(&new_pwd->kobj, &tlmi_pwd_setting_ktype);
-
 	return new_pwd;
 }
 
@@ -1687,7 +1695,6 @@ static int tlmi_analyze(struct wmi_device *wdev)
 		if (setting->possible_values)
 			strreplace(setting->possible_values, ',', ';');
 
-		kobject_init(&setting->kobj, &tlmi_attr_setting_ktype);
 		tlmi_priv.setting[i] = setting;
 		kfree(item);
 	}

-- 
2.50.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/3] platform/x86: think-lmi: Fix sysfs group cleanup
  2025-06-28  5:00 [PATCH 0/3] platform/x86: think-lmi: Fix resource cleanup flaws Kurt Borja
  2025-06-28  5:00 ` [PATCH 1/3] platform/x86: think-lmi: Create ksets consecutively Kurt Borja
  2025-06-28  5:00 ` [PATCH 2/3] platform/x86: think-lmi: Fix kobject cleanup Kurt Borja
@ 2025-06-28  5:00 ` Kurt Borja
  2025-06-28 19:30 ` [PATCH 0/3] platform/x86: think-lmi: Fix resource cleanup flaws Mark Pearson
  3 siblings, 0 replies; 7+ messages in thread
From: Kurt Borja @ 2025-06-28  5:00 UTC (permalink / raw)
  To: Mark Pearson, Hans de Goede, Ilpo Järvinen
  Cc: platform-driver-x86, linux-kernel, Kurt Borja

Many error paths in tlmi_sysfs_init() lead to sysfs groups being removed
when they were not even created.

Fix this by letting the kobject core manage these groups through their
kobj_type's defult_groups.

Fixes: a40cd7ef22fb ("platform/x86: think-lmi: Add WMI interface support on Lenovo platforms")
Signed-off-by: Kurt Borja <kuurtb@gmail.com>
---
 drivers/platform/x86/lenovo/think-lmi.c | 43 +++------------------------------
 1 file changed, 4 insertions(+), 39 deletions(-)

diff --git a/drivers/platform/x86/lenovo/think-lmi.c b/drivers/platform/x86/lenovo/think-lmi.c
index da3568727d79832f4669d7217e2fdf691acf1cf5..a38262295abad9f97f67208dc9e3f4f4c6b27b32 100644
--- a/drivers/platform/x86/lenovo/think-lmi.c
+++ b/drivers/platform/x86/lenovo/think-lmi.c
@@ -975,6 +975,7 @@ static const struct attribute_group auth_attr_group = {
 	.is_visible = auth_attr_is_visible,
 	.attrs = auth_attrs,
 };
+__ATTRIBUTE_GROUPS(auth_attr);
 
 /* ---- Attributes sysfs --------------------------------------------------------- */
 static ssize_t display_name_show(struct kobject *kobj, struct kobj_attribute *attr,
@@ -1190,6 +1191,7 @@ static const struct attribute_group tlmi_attr_group = {
 	.is_visible = attr_is_visible,
 	.attrs = tlmi_attrs,
 };
+__ATTRIBUTE_GROUPS(tlmi_attr);
 
 static void tlmi_attr_setting_release(struct kobject *kobj)
 {
@@ -1209,11 +1211,13 @@ static void tlmi_pwd_setting_release(struct kobject *kobj)
 static const struct kobj_type tlmi_attr_setting_ktype = {
 	.release        = &tlmi_attr_setting_release,
 	.sysfs_ops	= &kobj_sysfs_ops,
+	.default_groups = tlmi_attr_groups,
 };
 
 static const struct kobj_type tlmi_pwd_setting_ktype = {
 	.release        = &tlmi_pwd_setting_release,
 	.sysfs_ops	= &kobj_sysfs_ops,
+	.default_groups = auth_attr_groups,
 };
 
 static ssize_t pending_reboot_show(struct kobject *kobj, struct kobj_attribute *attr,
@@ -1383,14 +1387,8 @@ static struct kobj_attribute debug_cmd = __ATTR_WO(debug_cmd);
 static void tlmi_release_attr(void)
 {
 	struct kobject *pos, *n;
-	int i;
 
 	/* Attribute structures */
-	for (i = 0; i < TLMI_SETTINGS_COUNT; i++) {
-		if (tlmi_priv.setting[i]) {
-			sysfs_remove_group(&tlmi_priv.setting[i]->kobj, &tlmi_attr_group);
-		}
-	}
 	sysfs_remove_file(&tlmi_priv.attribute_kset->kobj, &pending_reboot.attr);
 	sysfs_remove_file(&tlmi_priv.attribute_kset->kobj, &save_settings.attr);
 
@@ -1409,15 +1407,6 @@ static void tlmi_release_attr(void)
 	kfree(tlmi_priv.pwd_admin->save_signature);
 
 	/* Authentication structures */
-	sysfs_remove_group(&tlmi_priv.pwd_admin->kobj, &auth_attr_group);
-	sysfs_remove_group(&tlmi_priv.pwd_power->kobj, &auth_attr_group);
-
-	if (tlmi_priv.opcode_support) {
-		sysfs_remove_group(&tlmi_priv.pwd_system->kobj, &auth_attr_group);
-		sysfs_remove_group(&tlmi_priv.pwd_hdd->kobj, &auth_attr_group);
-		sysfs_remove_group(&tlmi_priv.pwd_nvme->kobj, &auth_attr_group);
-	}
-
 	list_for_each_entry_safe(pos, n, &tlmi_priv.authentication_kset->list, entry) {
 		kobject_del(pos);
 		kobject_put(pos);
@@ -1490,10 +1479,6 @@ static int tlmi_sysfs_init(void)
 					   NULL, "%s", tlmi_priv.setting[i]->display_name);
 		if (ret)
 			goto fail_create_attr;
-
-		ret = sysfs_create_group(&tlmi_priv.setting[i]->kobj, &tlmi_attr_group);
-		if (ret)
-			goto fail_create_attr;
 	}
 
 	ret = sysfs_create_file(&tlmi_priv.attribute_kset->kobj, &pending_reboot.attr);
@@ -1517,20 +1502,12 @@ static int tlmi_sysfs_init(void)
 	if (ret)
 		goto fail_create_attr;
 
-	ret = sysfs_create_group(&tlmi_priv.pwd_admin->kobj, &auth_attr_group);
-	if (ret)
-		goto fail_create_attr;
-
 	tlmi_priv.pwd_power->kobj.kset = tlmi_priv.authentication_kset;
 	ret = kobject_init_and_add(&tlmi_priv.pwd_power->kobj, &tlmi_pwd_setting_ktype,
 				   NULL, "%s", "Power-on");
 	if (ret)
 		goto fail_create_attr;
 
-	ret = sysfs_create_group(&tlmi_priv.pwd_power->kobj, &auth_attr_group);
-	if (ret)
-		goto fail_create_attr;
-
 	if (tlmi_priv.opcode_support) {
 		tlmi_priv.pwd_system->kobj.kset = tlmi_priv.authentication_kset;
 		ret = kobject_init_and_add(&tlmi_priv.pwd_system->kobj, &tlmi_pwd_setting_ktype,
@@ -1538,29 +1515,17 @@ static int tlmi_sysfs_init(void)
 		if (ret)
 			goto fail_create_attr;
 
-		ret = sysfs_create_group(&tlmi_priv.pwd_system->kobj, &auth_attr_group);
-		if (ret)
-			goto fail_create_attr;
-
 		tlmi_priv.pwd_hdd->kobj.kset = tlmi_priv.authentication_kset;
 		ret = kobject_init_and_add(&tlmi_priv.pwd_hdd->kobj, &tlmi_pwd_setting_ktype,
 					   NULL, "%s", "HDD");
 		if (ret)
 			goto fail_create_attr;
 
-		ret = sysfs_create_group(&tlmi_priv.pwd_hdd->kobj, &auth_attr_group);
-		if (ret)
-			goto fail_create_attr;
-
 		tlmi_priv.pwd_nvme->kobj.kset = tlmi_priv.authentication_kset;
 		ret = kobject_init_and_add(&tlmi_priv.pwd_nvme->kobj, &tlmi_pwd_setting_ktype,
 					   NULL, "%s", "NVMe");
 		if (ret)
 			goto fail_create_attr;
-
-		ret = sysfs_create_group(&tlmi_priv.pwd_nvme->kobj, &auth_attr_group);
-		if (ret)
-			goto fail_create_attr;
 	}
 
 	return ret;

-- 
2.50.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/3] platform/x86: think-lmi: Fix kobject cleanup
  2025-06-28  5:00 ` [PATCH 2/3] platform/x86: think-lmi: Fix kobject cleanup Kurt Borja
@ 2025-06-28  5:32   ` Kurt Borja
  0 siblings, 0 replies; 7+ messages in thread
From: Kurt Borja @ 2025-06-28  5:32 UTC (permalink / raw)
  To: Kurt Borja, Mark Pearson, Hans de Goede, Ilpo Järvinen
  Cc: platform-driver-x86, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1077 bytes --]

On Sat Jun 28, 2025 at 2:00 AM -03, Kurt Borja wrote:
> Cleanup of allocated kobjects has many flaws.
>
> In tlmi_analyze(), allocated structs with an embedded kobject are freed
> in error paths after the they were already initialized.
>
> In tlmi_release_attr(), which is called in tlmi_sysfs_init() error paths
> and in module exit, kobject_del() is never called. This, between other
> things, leaks the reference of the parent kobject, which is a kset in
> this case.
>
> Fix this flaws simultaneously, first by avoiding the initialization of
> kobjects in tlmi_analyze() and then by correctly cleaning them up in
> tlmi_release_attr() using their kset's kobject list.
>
> Fixes: a40cd7ef22fb ("platform/x86: think-lmi: Add WMI interface support on Lenovo platforms")
> Signed-off-by: Kurt Borja <kuurtb@gmail.com>

I missed some commits:

Fixes: 30e78435d3bf ("platform/x86: think-lmi: Split kobject_init() and kobject_add() calls")
Fixes: f7e506ec4a99 ("platform/x86: think-lmi: Fix possible mem-leaks on tlmi_analyze() error-exit")


-- 
 ~Kurt

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/3] platform/x86: think-lmi: Fix resource cleanup flaws
  2025-06-28  5:00 [PATCH 0/3] platform/x86: think-lmi: Fix resource cleanup flaws Kurt Borja
                   ` (2 preceding siblings ...)
  2025-06-28  5:00 ` [PATCH 3/3] platform/x86: think-lmi: Fix sysfs group cleanup Kurt Borja
@ 2025-06-28 19:30 ` Mark Pearson
  2025-06-28 20:26   ` Kurt Borja
  3 siblings, 1 reply; 7+ messages in thread
From: Mark Pearson @ 2025-06-28 19:30 UTC (permalink / raw)
  To: Kurt Borja, Hans de Goede, Ilpo Järvinen
  Cc: platform-driver-x86@vger.kernel.org, linux-kernel

Thanks Kurt,

On Sat, Jun 28, 2025, at 2:00 PM, Kurt Borja wrote:
> Hi all,
>
> First patch is a prerequisite in order to avoid NULL pointer
> dereferences in error paths. Then two fixes follow.
>
> Signed-off-by: Kurt Borja <kuurtb@gmail.com>
> ---
> Kurt Borja (3):
>       platform/x86: think-lmi: Create ksets consecutively
>       platform/x86: think-lmi: Fix kobject cleanup
>       platform/x86: think-lmi: Fix sysfs group cleanup
>
>  drivers/platform/x86/lenovo/think-lmi.c | 92 ++++++++++++---------------------
>  1 file changed, 33 insertions(+), 59 deletions(-)
> ---
> base-commit: 73f0f2b52c5ea67b3140b23f58d8079d158839c8
> change-id: 20250628-lmi-fix-98143b10d9fd
> -- 
>  ~ Kurt

The patches all look good to me:
Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca>

The only caveat is I tried a build and system won't boot. I don't think it's related to your changes, but it means I've not been able to actually test them to confirm all working normally. I'll dig a bit more and figure out what is going on.

Mark

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/3] platform/x86: think-lmi: Fix resource cleanup flaws
  2025-06-28 19:30 ` [PATCH 0/3] platform/x86: think-lmi: Fix resource cleanup flaws Mark Pearson
@ 2025-06-28 20:26   ` Kurt Borja
  0 siblings, 0 replies; 7+ messages in thread
From: Kurt Borja @ 2025-06-28 20:26 UTC (permalink / raw)
  To: Mark Pearson, Hans de Goede, Ilpo Järvinen
  Cc: platform-driver-x86@vger.kernel.org, linux-kernel

On Sat Jun 28, 2025 at 4:30 PM -03, Mark Pearson wrote:
> Thanks Kurt,
>
> On Sat, Jun 28, 2025, at 2:00 PM, Kurt Borja wrote:
>> Hi all,
>>
>> First patch is a prerequisite in order to avoid NULL pointer
>> dereferences in error paths. Then two fixes follow.
>>
>> Signed-off-by: Kurt Borja <kuurtb@gmail.com>
>> ---
>> Kurt Borja (3):
>>       platform/x86: think-lmi: Create ksets consecutively
>>       platform/x86: think-lmi: Fix kobject cleanup
>>       platform/x86: think-lmi: Fix sysfs group cleanup
>>
>>  drivers/platform/x86/lenovo/think-lmi.c | 92 ++++++++++++---------------------
>>  1 file changed, 33 insertions(+), 59 deletions(-)
>> ---
>> base-commit: 73f0f2b52c5ea67b3140b23f58d8079d158839c8
>> change-id: 20250628-lmi-fix-98143b10d9fd
>> -- 
>>  ~ Kurt
>
> The patches all look good to me:
> Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca>

Thanks!

>
> The only caveat is I tried a build and system won't boot. I don't think it's related to your changes, but it means I've not been able to actually test them to confirm all working normally. I'll dig a bit more and figure out what is going on.

Let me know if the problem persists only when the patches are applied.

>
> Mark

PD: After reading the kobject code I realized kobject_del() call is
completely optional. I'll send a v2 without it.


-- 
 ~ Kurt

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-06-28 20:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-28  5:00 [PATCH 0/3] platform/x86: think-lmi: Fix resource cleanup flaws Kurt Borja
2025-06-28  5:00 ` [PATCH 1/3] platform/x86: think-lmi: Create ksets consecutively Kurt Borja
2025-06-28  5:00 ` [PATCH 2/3] platform/x86: think-lmi: Fix kobject cleanup Kurt Borja
2025-06-28  5:32   ` Kurt Borja
2025-06-28  5:00 ` [PATCH 3/3] platform/x86: think-lmi: Fix sysfs group cleanup Kurt Borja
2025-06-28 19:30 ` [PATCH 0/3] platform/x86: think-lmi: Fix resource cleanup flaws Mark Pearson
2025-06-28 20:26   ` Kurt Borja

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).