Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 29422737 authored by Sean Young's avatar Sean Young Committed by Mauro Carvalho Chehab
Browse files

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: default avatarSean Young <sean@mess.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent c2837ad0
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -249,8 +249,6 @@ static ssize_t ir_lirc_transmit_ir(struct file *file, const char __user *buf,
		goto out_unlock;
		goto out_unlock;
	}
	}


	start = ktime_get();

	if (!dev->tx_ir) {
	if (!dev->tx_ir) {
		ret = -EINVAL;
		ret = -EINVAL;
		goto out_unlock;
		goto out_unlock;
@@ -343,6 +341,8 @@ static ssize_t ir_lirc_transmit_ir(struct file *file, const char __user *buf,
		duration += txbuf[i];
		duration += txbuf[i];
	}
	}


	start = ktime_get();

	ret = dev->tx_ir(dev, txbuf, count);
	ret = dev->tx_ir(dev, txbuf, count);
	if (ret < 0)
	if (ret < 0)
		goto out_kfree;
		goto out_kfree;