From: Dmitry Torokhov Date: Tue, 27 Jun 2006 12:30:31 +0000 (-0400) Subject: Input: fix resetting name, phys and uniq when unregistering device X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e7374e48009a15a680d53bd1f9828b9b79a8aac9;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git Input: fix resetting name, phys and uniq when unregistering device It should be done before calling class_device_unregister() because it will destroy the device and free memory if there are no other references to the device. Signed-off-by: Dmitry Torokhov Signed-off-by: Linus Torvalds --- diff --git a/drivers/input/input.c b/drivers/input/input.c index de2e7546b49..a90486f5e49 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c @@ -998,12 +998,13 @@ void input_unregister_device(struct input_dev *dev) sysfs_remove_group(&dev->cdev.kobj, &input_dev_caps_attr_group); sysfs_remove_group(&dev->cdev.kobj, &input_dev_id_attr_group); sysfs_remove_group(&dev->cdev.kobj, &input_dev_attr_group); - class_device_unregister(&dev->cdev); mutex_lock(&dev->mutex); dev->name = dev->phys = dev->uniq = NULL; mutex_unlock(&dev->mutex); + class_device_unregister(&dev->cdev); + input_wakeup_procfs_readers(); } EXPORT_SYMBOL(input_unregister_device);