Skip to contentSkip to conversation

Input: Add check for grabbed device before flushing the device

PATCH New [email protected] 1 participant 1 message Dec 30, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Input: Add check for grabbed device before flushing the device

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.

---
 drivers/input/evdev.c |    2 ++
 1 file changed, 2 insertions(+)
drivers/input/evdev.c +2 -0
index fd325ec..70df398 100644
@@ -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);
 
Signature · 1 line
1.7.9.5