提交 eb08b6b9 编写于 作者: B Björn Steinbrink 提交者: Linus Torvalds

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: NBjörn Steinbrink <B.Steinbrink@gmx.de>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 d6e4218e
...@@ -853,6 +853,9 @@ static void evdev_cleanup(struct evdev *evdev) ...@@ -853,6 +853,9 @@ static void evdev_cleanup(struct evdev *evdev)
evdev_hangup(evdev); evdev_hangup(evdev);
evdev_remove_chrdev(evdev); evdev_remove_chrdev(evdev);
if (evdev->grab)
evdev_ungrab(evdev, evdev->grab);
/* evdev is marked dead so no one else accesses evdev->open */ /* evdev is marked dead so no one else accesses evdev->open */
if (evdev->open) { if (evdev->open) {
input_flush_device(handle, NULL); input_flush_device(handle, NULL);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册