mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 19:08:57 +09:00
UPSTREAM: media: rc: get start time just before calling driver tx
The current code gets the start time before copying the IR from
userspace (could cause page faults) and encoding IR. This means
that the gap calculation could be off.
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
(cherry picked from commit 2942273701)
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
This commit is contained in:
@@ -253,8 +253,6 @@ static ssize_t ir_lirc_transmit_ir(struct file *file, const char __user *buf,
|
||||
goto out_unlock;
|
||||
}
|
||||
|
||||
start = ktime_get();
|
||||
|
||||
if (!dev->tx_ir) {
|
||||
ret = -EINVAL;
|
||||
goto out_unlock;
|
||||
@@ -347,6 +345,8 @@ static ssize_t ir_lirc_transmit_ir(struct file *file, const char __user *buf,
|
||||
duration += txbuf[i];
|
||||
}
|
||||
|
||||
start = ktime_get();
|
||||
|
||||
ret = dev->tx_ir(dev, txbuf, count);
|
||||
if (ret < 0)
|
||||
goto out_kfree;
|
||||
|
||||
Reference in New Issue
Block a user