From: Sean Young Date: Thu, 19 Jan 2017 21:44:00 +0000 (-0200) Subject: [media] lirc: LIRC_GET_MIN_TIMEOUT should be in range X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f348b4d323a67a5639ccbd3de5add5383573e4a5;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [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 Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/rc/ir-lirc-codec.c b/drivers/media/rc/ir-lirc-codec.c index e944507fc4f5..8517d5153fcf 100644 --- a/drivers/media/rc/ir-lirc-codec.c +++ b/drivers/media/rc/ir-lirc-codec.c @@ -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: