evdev: Release eventual input device grabs when getting disconnected
[sfrench/cifs-2.6.git] / drivers / input / evdev.c
index 0727b0a12557cad63cdf308ac2d7a172a83959ae..99562cee827e7c6af548ec2f889b3fc769dd9213 100644 (file)
@@ -853,6 +853,9 @@ static void evdev_cleanup(struct evdev *evdev)
        evdev_hangup(evdev);
        evdev_remove_chrdev(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);
        /* evdev is marked dead so no one else accesses evdev->open */
        if (evdev->open) {
                input_flush_device(handle, NULL);