All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anshul Garg <aksgarg1989@gmail.com>
To: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org
Cc: aksgarg1989@gmail.com
Subject: [PATCH] Input-polldev:Check poll_interval range while registering input device
Date: Thu, 16 Jul 2015 10:57:13 -0700	[thread overview]
Message-ID: <1437069433-76366-1-git-send-email-aksgarg1989@gmail.com> (raw)
In-Reply-To: <aksgarg1989@gmail.com>

Added check for poll_interval range in input_register_polled_device
function similar to input_polldev_set_poll function.

Signed-off-by: Anshul Garg <aksgarg1989@gmail.com>
---
 drivers/input/input-polldev.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/input/input-polldev.c b/drivers/input/input-polldev.c
index 3664f81..0e88a9e 100644
--- a/drivers/input/input-polldev.c
+++ b/drivers/input/input-polldev.c
@@ -309,6 +309,12 @@ int input_register_polled_device(struct input_polled_dev *dev)
 
 	input_set_drvdata(input, dev);
 	INIT_DELAYED_WORK(&dev->work, input_polled_device_work);
+
+	if (dev->poll_interval > dev->poll_interval_max ||
+			dev->poll_interval < dev->poll_interval_min) {
+		pr_err("Poll interval Range incorrect\n");
+		return -EINVAL;
+	}
 
 	if (!dev->poll_interval)
 		dev->poll_interval = 500;
-- 
1.7.9.5


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus


             reply	other threads:[~2015-07-16 17:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-16 17:57 Anshul Garg [this message]
2015-07-16 19:35 ` [PATCH] Input-polldev:Check poll_interval range while registering input device Dmitry Torokhov
2015-07-17 13:41   ` Anshul Garg
2015-07-17 21:29     ` Dmitry Torokhov
2015-07-17 20:29 ` Marcus Overhagen
  -- strict thread matches above, loose matches on Subject: below --
2015-07-14 13:25 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=1437069433-76366-1-git-send-email-aksgarg1989@gmail.com \
    --to=aksgarg1989@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    /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.