Skip to content

Commit 5ff1fbb

Browse files
kuu-rtij-intel
authored andcommitted
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: a40cd7e ("platform/x86: think-lmi: Add WMI interface support on Lenovo platforms") Signed-off-by: Kurt Borja <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Ilpo Järvinen <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]>
1 parent 11cba47 commit 5ff1fbb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/platform/x86/think-lmi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1554,7 +1554,7 @@ static int tlmi_sysfs_init(void)
15541554
fail_create_attr:
15551555
tlmi_release_attr();
15561556
fail_device_created:
1557-
device_destroy(&firmware_attributes_class, MKDEV(0, 0));
1557+
device_unregister(tlmi_priv.class_dev);
15581558
fail_class_created:
15591559
return ret;
15601560
}
@@ -1781,7 +1781,7 @@ static int tlmi_analyze(struct wmi_device *wdev)
17811781
static void tlmi_remove(struct wmi_device *wdev)
17821782
{
17831783
tlmi_release_attr();
1784-
device_destroy(&firmware_attributes_class, MKDEV(0, 0));
1784+
device_unregister(tlmi_priv.class_dev);
17851785
}
17861786

17871787
static int tlmi_probe(struct wmi_device *wdev, const void *context)

0 commit comments

Comments
 (0)