From: Anshul Garg <[email protected]>

If input device is grabbed then client which grabbed the device should only
flush the device and for other clients error should be returned.

Signed-off-by: Anshul Garg <[email protected]>
---
 drivers/input/evdev.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c
index fd325ec..70df398 100644
--- a/drivers/input/evdev.c
+++ b/drivers/input/evdev.c
@@ -248,6 +248,8 @@ static int evdev_flush(struct file *file, fl_owner_t id)
 
        if (!evdev->exist || client->revoked)
                retval = -ENODEV;
+       else if (evdev->grab != client)
+               retval = -EINVAL;
        else
                retval = input_flush_device(&evdev->handle, file);
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to