All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexey Ignatov <lexszero@gmail.com>
To: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Andi Shyti <andi.shyti@samsung.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Alexey Ignatov <lexszero@gmail.com>
Subject: [PATCH] [media] lirc_dev: fix regression in feature check logic in ioctl
Date: Tue,  4 Apr 2017 02:19:16 +0300	[thread overview]
Message-ID: <20170403231916.22881-1-lexszero@gmail.com> (raw)

Commit 273b902a5b1bfd6977a73c4de3eb96db3cb103cb removed inversion in
features check conditionals (by accident, perhaps). That change resulted
in erroneous reporting that device can't receive while actually it can.
Fix this.

Signed-off-by: Alexey Ignatov <lexszero@gmail.com>
---
 drivers/media/rc/lirc_dev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c
index e65bc9fd1d23..cd07af05be69 100644
--- a/drivers/media/rc/lirc_dev.c
+++ b/drivers/media/rc/lirc_dev.c
@@ -591,7 +591,7 @@ long lirc_dev_fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 		result = put_user(ir->d.features, (__u32 __user *)arg);
 		break;
 	case LIRC_GET_REC_MODE:
-		if (LIRC_CAN_REC(ir->d.features)) {
+		if (!LIRC_CAN_REC(ir->d.features)) {
 			result = -ENOTTY;
 			break;
 		}
@@ -601,7 +601,7 @@ long lirc_dev_fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 				  (__u32 __user *)arg);
 		break;
 	case LIRC_SET_REC_MODE:
-		if (LIRC_CAN_REC(ir->d.features)) {
+		if (!LIRC_CAN_REC(ir->d.features)) {
 			result = -ENOTTY;
 			break;
 		}
-- 
2.11.0

             reply	other threads:[~2017-04-03 23:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20170403232013epcas5p29f40704fb57de62bf45369d5b6442a88@epcas5p2.samsung.com>
2017-04-03 23:19 ` Alexey Ignatov [this message]
2017-04-04  2:30   ` [PATCH] [media] lirc_dev: fix regression in feature check logic in ioctl Andi Shyti

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170403231916.22881-1-lexszero@gmail.com \
    --to=lexszero@gmail.com \
    --cc=andi.shyti@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.