Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e7374e48 authored by Dmitry Torokhov's avatar Dmitry Torokhov Committed by Linus Torvalds
Browse files

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: default avatarDmitry Torokhov <dtor@mail.ru>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent d38b6968
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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);