aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Steinbrink <B.Steinbrink@gmx.de>2008-03-30 14:42:59 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-03-30 17:47:49 -0400
commiteb08b6b973cb91311431c6eea3cc232b97152a84 (patch)
treee5ee937a643f86302abaf72ff1fd09e381d445ec
parentd6e4218e28b75c4701a8c8d12e989de1dc97c182 (diff)
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>
-rw-r--r--drivers/input/evdev.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c
index 0727b0a12557..99562cee827e 100644
--- a/drivers/input/evdev.c
+++ b/drivers/input/evdev.c
@@ -853,6 +853,9 @@ static void evdev_cleanup(struct evdev *evdev)
853 evdev_hangup(evdev); 853 evdev_hangup(evdev);
854 evdev_remove_chrdev(evdev); 854 evdev_remove_chrdev(evdev);
855 855
856 if (evdev->grab)
857 evdev_ungrab(evdev, evdev->grab);
858
856 /* evdev is marked dead so no one else accesses evdev->open */ 859 /* evdev is marked dead so no one else accesses evdev->open */
857 if (evdev->open) { 860 if (evdev->open) {
858 input_flush_device(handle, NULL); 861 input_flush_device(handle, NULL);