]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
platform/x86: think-lmi: Fix sysfs group cleanup
authorKurt Borja <kuurtb@gmail.com>
Mon, 30 Jun 2025 17:31:21 +0000 (14:31 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Jul 2025 14:03:20 +0000 (16:03 +0200)
commit4b91b77af24c4a2d9f1d68cf7d3e2bf55474195b
tree6eebd4730618b36654803fc2c3fad6972fded756
parent98002f1ac947f63f8eda0f3d1f576a50a4daa91f
platform/x86: think-lmi: Fix sysfs group cleanup

commit 4f30f946f27b7f044cf8f3f1f353dee1dcd3517a upstream.

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")
Cc: stable@vger.kernel.org
Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Kurt Borja <kuurtb@gmail.com>
Link: https://lore.kernel.org/r/20250630-lmi-fix-v3-3-ce4f81c9c481@gmail.com
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/platform/x86/think-lmi.c