diff options
author | Sean Young <sean@mess.org> | 2018-04-18 11:36:25 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2018-04-20 15:21:47 +0200 |
commit | 91352b572786a49f26a12e8b1b7571bc3df64bab (patch) | |
tree | b9ea60bb855042da7057bde059fb5846d017897a /drivers/media/rc/mceusb.c | |
parent | media: rc: mce_kbd decoder: fix race condition (diff) | |
download | linux-91352b572786a49f26a12e8b1b7571bc3df64bab.tar.xz linux-91352b572786a49f26a12e8b1b7571bc3df64bab.zip |
media: rc: mceusb: IR of length 0 means IR timeout, not reset
The last usb packet with IR data will end with 0x80 (MCE_IRDATA_TRAILER).
If we reset the decoder state at this point, IR decoding can fail.
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/rc/mceusb.c')
-rw-r--r-- | drivers/media/rc/mceusb.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/media/rc/mceusb.c b/drivers/media/rc/mceusb.c index 69ba57372c05..a1c21903b96c 100644 --- a/drivers/media/rc/mceusb.c +++ b/drivers/media/rc/mceusb.c @@ -1182,7 +1182,12 @@ static void mceusb_process_ir_data(struct mceusb_dev *ir, int buf_len) if (ir->rem) { ir->parser_state = PARSE_IRDATA; } else { - ir_raw_event_reset(ir->rc); + init_ir_raw_event(&rawir); + rawir.timeout = 1; + rawir.duration = ir->rc->timeout; + if (ir_raw_event_store_with_filter(ir->rc, + &rawir)) + event = true; ir->pulse_tunit = 0; ir->pulse_count = 0; } |