Skip to contentSkip to conversation

Input-polldev:Check poll_interval range while registering input device

PATCH New Anshul Garg 1 participant 1 message Jul 14, 2015

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

PATCH 1/1 Input-polldev:Check poll_interval range while registering input device

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

---
 drivers/input/input-polldev.c |    6 ++++++
 1 file changed, 6 insertions(+)
drivers/input/input-polldev.c +6 -0
index 3664f81..0e88a9e 100644
@@ -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;
Signature · 6 lines
1.7.9.5


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