All of lore.kernel.org
 help / color / mirror / Atom feed
From: anshul.g@samsung.com
To: dmitry.torokhov@gmail.com, dtor@mail.ru, linux-input@vger.kernel.org
Cc: aksgarg1989@gmail.com, anshul.g@samsung.com, p.shailesh@samsung.com
Subject: [PATCH] Input: Add check for grabbed device before flushing the device
Date: Tue, 30 Dec 2014 11:17:50 +0530	[thread overview]
Message-ID: <1419918470-14940-1-git-send-email-anshul.g@samsung.com> (raw)

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


             reply	other threads:[~2014-12-30  5:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-30  5:47 anshul.g [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-12-30  5:32 [PATCH] Input: Add check for grabbed device before flushing the device Anshul, Garg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1419918470-14940-1-git-send-email-anshul.g@samsung.com \
    --to=anshul.g@samsung.com \
    --cc=aksgarg1989@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=dtor@mail.ru \
    --cc=linux-input@vger.kernel.org \
    --cc=p.shailesh@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.