diff options
author | Sean Young <sean@mess.org> | 2018-02-12 17:00:28 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2018-02-14 22:17:21 +0300 |
commit | 29422737017b866d4a51014cc7522fa3a99e8852 (patch) | |
tree | a9d752840ca4b4fc092b82386d9aac3454ce7d86 /drivers/media/rc | |
parent | c2837ad09018807437f1249d30915e70dd6b6bbe (diff) | |
download | linux-29422737017b866d4a51014cc7522fa3a99e8852.tar.xz |
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>
Diffstat (limited to 'drivers/media/rc')
-rw-r--r-- | drivers/media/rc/lirc_dev.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c index fd3860d50034..da3b5c095a59 100644 --- a/drivers/media/rc/lirc_dev.c +++ b/drivers/media/rc/lirc_dev.c @@ -249,8 +249,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; @@ -343,6 +341,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; |