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

Commit 92d8a047 authored by Sean Young's avatar Sean Young Committed by Greg Kroah-Hartman
Browse files

media: lirc: drop trailing space from scancode transmit



commit c8a489f820179fb12251e262b50303c29de991ac upstream.

When transmitting, infrared drivers expect an odd number of samples; iow
without a trailing space. No problems have been observed so far, so
this is just belt and braces.

Fixes: 9b619258 ("media: lirc: implement scancode sending")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarSean Young <sean@mess.org>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent cac054d1
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -292,6 +292,10 @@ static ssize_t ir_lirc_transmit_ir(struct file *file, const char __user *buf,
		if (ret < 0)
			goto out_kfree_raw;

		/* drop trailing space */
		if (!(ret % 2))
			count = ret - 1;
		else
			count = ret;

		txbuf = kmalloc_array(count, sizeof(unsigned int), GFP_KERNEL);