mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +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
|
@ -1227,12 +1227,13 @@ void input_free_device(struct input_dev *dev);
|
|||
|
||||
static inline struct input_dev *input_get_device(struct input_dev *dev)
|
||||
{
|
||||
return to_input_dev(get_device(&dev->dev));
|
||||
return dev ? to_input_dev(get_device(&dev->dev)) : NULL;
|
||||
}
|
||||
|
||||
static inline void input_put_device(struct input_dev *dev)
|
||||
{
|
||||
put_device(&dev->dev);
|
||||
if (dev)
|
||||
put_device(&dev->dev);
|
||||
}
|
||||
|
||||
static inline void *input_get_drvdata(struct input_dev *dev)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue