mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-23 15:11:16 +00:00
Input: make sure input interfaces pin parent input devices
Recent driver core change causes references to parent devices being dropped early, at device_del() time, as opposed to when all children are freed. This causes oops in evdev with grabbed devices. Take the reference to the parent input device ourselves to ensure that it stays around long enough. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
This commit is contained in:
parent
399f486286
commit
a7097ff89c
4 changed files with 9 additions and 8 deletions
|
@ -124,6 +124,7 @@ static void evdev_free(struct device *dev)
|
|||
{
|
||||
struct evdev *evdev = container_of(dev, struct evdev, dev);
|
||||
|
||||
input_put_device(evdev->handle.dev);
|
||||
kfree(evdev);
|
||||
}
|
||||
|
||||
|
@ -853,9 +854,6 @@ static void evdev_cleanup(struct evdev *evdev)
|
|||
evdev_hangup(evdev);
|
||||
evdev_remove_chrdev(evdev);
|
||||
|
||||
if (evdev->grab)
|
||||
evdev_ungrab(evdev, evdev->grab);
|
||||
|
||||
/* evdev is marked dead so no one else accesses evdev->open */
|
||||
if (evdev->open) {
|
||||
input_flush_device(handle, NULL);
|
||||
|
@ -896,7 +894,7 @@ static int evdev_connect(struct input_handler *handler, struct input_dev *dev,
|
|||
evdev->exist = 1;
|
||||
evdev->minor = minor;
|
||||
|
||||
evdev->handle.dev = dev;
|
||||
evdev->handle.dev = input_get_device(dev);
|
||||
evdev->handle.name = evdev->name;
|
||||
evdev->handle.handler = handler;
|
||||
evdev->handle.private = evdev;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue