diff mbox series

[1/4] media: rc-loopback: return set of valid emitters rather error

Message ID 3794b019b5ba41fcc2b1212c89b170129e1859c6.1625324530.git.sean@mess.org (mailing list archive)
State New, archived
Headers show
Series Various rc-loopback fixes | expand

Commit Message

Sean Young July 3, 2021, 3:03 p.m. UTC
The LIRC_SET_TRANSMITTER_MASK ioctl should return a list valid emitters
if an invalid list was passed.

Cc: stable@vger.kernel.org
Signed-off-by: Sean Young <sean@mess.org>
---
 drivers/media/rc/rc-loopback.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/media/rc/rc-loopback.c b/drivers/media/rc/rc-loopback.c
index 1ba3f96ffa7d..15212244f83c 100644
--- a/drivers/media/rc/rc-loopback.c
+++ b/drivers/media/rc/rc-loopback.c
@@ -42,7 +42,7 @@  static int loop_set_tx_mask(struct rc_dev *dev, u32 mask)
 
 	if ((mask & (RXMASK_REGULAR | RXMASK_LEARNING)) != mask) {
 		dprintk("invalid tx mask: %u\n", mask);
-		return -EINVAL;
+		return RXMASK_REGULAR | RXMASK_LEARNING;
 	}
 
 	dprintk("setting tx mask: %u\n", mask);