Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

platform/x86: think-lmi: Fix class device unregistration

Devices under the firmware_attributes_class do not have unique a dev_t.
Therefore, device_unregister() should be used instead of
device_destroy(), since the latter may match any device with a given
dev_t.

Fixes: a40cd7ef22fb ("platform/x86: think-lmi: Add WMI interface support on Lenovo platforms")
Signed-off-by: Kurt Borja <kuurtb@gmail.com>
Link: https://lore.kernel.org/r/20250625-dest-fix-v1-2-3a0f342312bb@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

authored by

Kurt Borja and committed by
Ilpo Järvinen
5ff1fbb3 11cba479

+2 -2
+2 -2
drivers/platform/x86/think-lmi.c
··· 1554 1554 fail_create_attr: 1555 1555 tlmi_release_attr(); 1556 1556 fail_device_created: 1557 - device_destroy(&firmware_attributes_class, MKDEV(0, 0)); 1557 + device_unregister(tlmi_priv.class_dev); 1558 1558 fail_class_created: 1559 1559 return ret; 1560 1560 } ··· 1781 1781 static void tlmi_remove(struct wmi_device *wdev) 1782 1782 { 1783 1783 tlmi_release_attr(); 1784 - device_destroy(&firmware_attributes_class, MKDEV(0, 0)); 1784 + device_unregister(tlmi_priv.class_dev); 1785 1785 } 1786 1786 1787 1787 static int tlmi_probe(struct wmi_device *wdev, const void *context)