mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
UPSTREAM: [media] lirc: LIRC_GET_MIN_TIMEOUT should be in range
LIRC_SET_REC_TIMEOUT can fail if the value returned by
LIRC_GET_MIN_TIMEOUT is set due to rounding errors.
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
(cherry picked from commit f348b4d323)
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
This commit is contained in:
@@ -279,7 +279,7 @@ static long ir_lirc_ioctl(struct file *filep, unsigned int cmd,
|
||||
case LIRC_GET_MIN_TIMEOUT:
|
||||
if (!dev->max_timeout)
|
||||
return -ENOSYS;
|
||||
val = dev->min_timeout / 1000;
|
||||
val = DIV_ROUND_UP(dev->min_timeout, 1000);
|
||||
break;
|
||||
|
||||
case LIRC_GET_MAX_TIMEOUT:
|
||||
|
||||
Reference in New Issue
Block a user