summaryrefslogtreecommitdiffstats
path: root/drivers/media/rc
diff options
context:
space:
mode:
authorSean Young <sean@mess.org>2022-09-02 12:32:21 +0200
committerMauro Carvalho Chehab <mchehab@kernel.org>2022-09-24 07:50:42 +0200
commit20b794ddce475ed012deb365000527c17b3e93e6 (patch)
treef7bcb116eaecd0587a0312997fb0977769697ec9 /drivers/media/rc
parent2dfe2c4f1720b6b0860d36d25107ffa57f0bbc63 (diff)
downloadlinux-20b794ddce475ed012deb365000527c17b3e93e6.tar.bz2
media: mceusb: set timeout to at least timeout provided
By rounding down, the actual timeout can be lower than requested. As a result, long spaces just below the requested timeout can be incorrectly reported as timeout and truncated. Fixes: 877f1a7cee3f ("media: rc: mceusb: allow the timeout to be configurable") Cc: stable@vger.kernel.org Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/media/rc')
-rw-r--r--drivers/media/rc/mceusb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/rc/mceusb.c b/drivers/media/rc/mceusb.c
index 39d2b03e2631..c76ba24c1f55 100644
--- a/drivers/media/rc/mceusb.c
+++ b/drivers/media/rc/mceusb.c
@@ -1077,7 +1077,7 @@ static int mceusb_set_timeout(struct rc_dev *dev, unsigned int timeout)
struct mceusb_dev *ir = dev->priv;
unsigned int units;
- units = DIV_ROUND_CLOSEST(timeout, MCE_TIME_UNIT);
+ units = DIV_ROUND_UP(timeout, MCE_TIME_UNIT);
cmdbuf[2] = units >> 8;
cmdbuf[3] = units;