linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input: Add check for grabbed device before flushing the device
@ 2014-12-30  5:32 Anshul, Garg
  0 siblings, 0 replies; 2+ messages in thread
From: Anshul, Garg @ 2014-12-30  5:32 UTC (permalink / raw)
  To: dmitry.torokhov, dtor, linux-input; +Cc: aksgarg1989, anshul.g, p.shailesh

From: Anshul Garg <anshul.g@samsung.com>

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 <anshul.g@samsung.com>
---
 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


^ permalink raw reply related	[flat|nested] 2+ messages in thread
* [PATCH] Input: Add check for grabbed device before flushing the device
@ 2014-12-30  5:47 anshul.g
  0 siblings, 0 replies; 2+ messages in thread
From: anshul.g @ 2014-12-30  5:47 UTC (permalink / raw)
  To: dmitry.torokhov, dtor, linux-input; +Cc: aksgarg1989, anshul.g, p.shailesh

From: Anshul Garg <anshul.g@samsung.com>

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 <anshul.g@samsung.com>
---
 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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-12-30  5:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-30  5:32 [PATCH] Input: Add check for grabbed device before flushing the device Anshul, Garg
  -- strict thread matches above, loose matches on Subject: below --
2014-12-30  5:47 anshul.g

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).