summaryrefslogtreecommitdiffstats
path: root/drivers/media/rc/lirc_dev.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-08 04:21:35 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-08 04:21:35 +0000
commit7b642cd94bb96385cbdbb36a1952f129af6b1bbb (patch)
treee7c4209372da8a2fa745aaa3e99d062e54d0f556 /drivers/media/rc/lirc_dev.c
parentAdding debian version 4.19.289-2. (diff)
downloadlinux-7b642cd94bb96385cbdbb36a1952f129af6b1bbb.tar.xz
linux-7b642cd94bb96385cbdbb36a1952f129af6b1bbb.zip
Merging upstream version 4.19.304.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'drivers/media/rc/lirc_dev.c')
-rw-r--r--drivers/media/rc/lirc_dev.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c
index d6f5f5b3f..b71792f49 100644
--- a/drivers/media/rc/lirc_dev.c
+++ b/drivers/media/rc/lirc_dev.c
@@ -302,7 +302,11 @@ static ssize_t ir_lirc_transmit_ir(struct file *file, const char __user *buf,
if (ret < 0)
goto out_kfree_raw;
- count = ret;
+ /* drop trailing space */
+ if (!(ret % 2))
+ count = ret - 1;
+ else
+ count = ret;
txbuf = kmalloc_array(count, sizeof(unsigned int), GFP_KERNEL);
if (!txbuf) {