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>

authored by Björn Steinbrink and committed by Linus Torvalds eb08b6b9 d6e4218e

+3
+3
drivers/input/evdev.c
··· 853 853 evdev_hangup(evdev); 854 854 evdev_remove_chrdev(evdev); 855 855 856 + if (evdev->grab) 857 + evdev_ungrab(evdev, evdev->grab); 858 + 856 859 /* evdev is marked dead so no one else accesses evdev->open */ 857 860 if (evdev->open) { 858 861 input_flush_device(handle, NULL);