|
@@ -140,11 +140,20 @@ static ssize_t ir_lirc_transmit_ir(struct file *file, const char __user *buf,
|
|
|
goto out;
|
|
|
}
|
|
|
|
|
|
+ for (i = 0; i < count; i++) {
|
|
|
+ if (txbuf[i] > IR_MAX_DURATION / 1000 - duration || !txbuf[i]) {
|
|
|
+ ret = -EINVAL;
|
|
|
+ goto out;
|
|
|
+ }
|
|
|
+
|
|
|
+ duration += txbuf[i];
|
|
|
+ }
|
|
|
+
|
|
|
ret = dev->tx_ir(dev, txbuf, count);
|
|
|
if (ret < 0)
|
|
|
goto out;
|
|
|
|
|
|
- for (i = 0; i < ret; i++)
|
|
|
+ for (duration = i = 0; i < ret; i++)
|
|
|
duration += txbuf[i];
|
|
|
|
|
|
ret *= sizeof(unsigned int);
|