Re: [PATCH] Input-polldev:Check poll_interval range while registering input device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Mr. Dmitry
,



On Fri, Jul 17, 2015 at 1:05 AM, Dmitry Torokhov
<dmitry.torokhov@xxxxxxxxx> wrote:
> Hi Anshul,
>
> On Thu, Jul 16, 2015 at 10:57:13AM -0700, Anshul Garg wrote:
>> 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@xxxxxxxxx>
>> ---
>>  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;
>> +     }
>
> What driver was this change tested with?
I have not checked this change for any driver.

This check is useful if some input driver is setting outofrange
poll_interval value
i.e. not in range between min,max. Similar to input_polldev_set_poll
which does this
when user space tries to change poll interval

Thanks
Anshul Garg
>
> Thanks.
>
> --
> Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux