public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [media] lirc_dev: fix regression in feature check logic in ioctl
@ 2017-04-03 23:19 ` Alexey Ignatov
  2017-04-04  2:30   ` Andi Shyti
  0 siblings, 1 reply; 2+ messages in thread
From: Alexey Ignatov @ 2017-04-03 23:19 UTC (permalink / raw)
  To: linux-media, linux-kernel
  Cc: Andi Shyti, Mauro Carvalho Chehab, Alexey Ignatov

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] [media] lirc_dev: fix regression in feature check logic in ioctl
  2017-04-03 23:19 ` [PATCH] [media] lirc_dev: fix regression in feature check logic in ioctl Alexey Ignatov
@ 2017-04-04  2:30   ` Andi Shyti
  0 siblings, 0 replies; 2+ messages in thread
From: Andi Shyti @ 2017-04-04  2:30 UTC (permalink / raw)
  To: Alexey Ignatov
  Cc: linux-media, linux-kernel, Mauro Carvalho Chehab, Sean Young

Hi Alexey,

this has been already fixed in commit bd291208d7f5 ("[media]
lirc_dev: LIRC_{G,S}ET_REC_MODE do not work") by Sean.

You need to update your kernel or cherry-pick this patch.

In any case, for future patches of this kind, some notes through
the lines:

On Tue, Apr 04, 2017 at 02:19:16AM +0300, Alexey Ignatov wrote:
> Commit 273b902a5b1bfd6977a73c4de3eb96db3cb103cb removed inversion in

References to commit should be of the kind:

Commit 273b902a5b1b ("[media] lirc_dev: use LIRC_CAN_REC() define
to check if the device can receive")

Please run checkpatch.pl before sending the patch.

> 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>

Here goes:

Fixes: 273b902a5b1b ("[media] lirc_dev: use LIRC_CAN_REC() define to check if the device can receive")
Cc: <stable@vger.kernel.org>

because it fixes a bug (check Sean's patch).

Thanks,
Andi

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-04-04  2:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CGME20170403232013epcas5p29f40704fb57de62bf45369d5b6442a88@epcas5p2.samsung.com>
2017-04-03 23:19 ` [PATCH] [media] lirc_dev: fix regression in feature check logic in ioctl Alexey Ignatov
2017-04-04  2:30   ` Andi Shyti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox