summaryrefslogtreecommitdiffstats
path: root/drivers/input/mousedev.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2008-04-01 00:22:53 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2008-04-01 00:22:53 -0400
commita7097ff89c3204737a07eecbc83f9ae6002cc534 (patch)
tree11fe55cbfb3651fc57e59fc838d1e084f5e63749 /drivers/input/mousedev.c
parent399f486286f44d55c4fff0e9cc5d712f2b443489 (diff)
downloadop-kernel-dev-a7097ff89c3204737a07eecbc83f9ae6002cc534.zip
op-kernel-dev-a7097ff89c3204737a07eecbc83f9ae6002cc534.tar.gz
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>
Diffstat (limited to 'drivers/input/mousedev.c')
-rw-r--r--drivers/input/mousedev.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/input/mousedev.c b/drivers/input/mousedev.c
index bbbe5e8..b989748 100644
--- a/drivers/input/mousedev.c
+++ b/drivers/input/mousedev.c
@@ -414,6 +414,7 @@ static void mousedev_free(struct device *dev)
{
struct mousedev *mousedev = container_of(dev, struct mousedev, dev);
+ input_put_device(mousedev->handle.dev);
kfree(mousedev);
}
@@ -865,7 +866,7 @@ static struct mousedev *mousedev_create(struct input_dev *dev,
mousedev->minor = minor;
mousedev->exist = 1;
- mousedev->handle.dev = dev;
+ mousedev->handle.dev = input_get_device(dev);
mousedev->handle.name = mousedev->name;
mousedev->handle.handler = handler;
mousedev->handle.private = mousedev;
OpenPOWER on IntegriCloud