From eb08b6b973cb91311431c6eea3cc232b97152a84 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bj=C3=B6rn=20Steinbrink?= Date: Sun, 30 Mar 2008 20:42:59 +0200 Subject: [PATCH] evdev: Release eventual input device grabs when getting disconnected MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Linus Torvalds --- drivers/input/evdev.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c index 0727b0a1255..99562cee827 100644 --- a/drivers/input/evdev.c +++ b/drivers/input/evdev.c @@ -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); -- 2.20.1