diff options
author | Sean Young <sean@mess.org> | 2022-09-02 13:32:21 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-10-29 11:12:54 +0300 |
commit | b22b4823a0a5685be7fa8625019fe999ff3fbc2c (patch) | |
tree | ba2478c393eca1934279dea8ece8738575cfdd13 /drivers/media/rc | |
parent | 5265cc1202a31f7097691c3483a0d60d624424a5 (diff) | |
download | linux-b22b4823a0a5685be7fa8625019fe999ff3fbc2c.tar.xz |
media: mceusb: set timeout to at least timeout provided
commit 20b794ddce475ed012deb365000527c17b3e93e6 upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/media/rc')
-rw-r--r-- | drivers/media/rc/mceusb.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/rc/mceusb.c b/drivers/media/rc/mceusb.c index deb3db45a94c..391de68365f6 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; |