mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 11:46:19 +00:00
evdev: Release eventual input device grabs when getting disconnected
When getting disconnected we need to release eventual grabs on the underlying input device as we also release the input device itself. Otherwise, we would try to release the grab when the client that requested it closes its handle, accessing the input device which might already be freed. Signed-off-by: Björn Steinbrink <B.Steinbrink@gmx.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
d6e4218e28
commit
eb08b6b973
1 changed files with 3 additions and 0 deletions
|
@ -853,6 +853,9 @@ 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);
|
||||
|
|
Loading…
Reference in a new issue