Commit d4589935 authored by Sean Young's avatar Sean Young Committed by Mauro Carvalho Chehab

media: mceusb: filter out bogus timing irdata of duration 0

A mceusb device has been observed producing invalid irdata. Proactively
guard against this.
Suggested-by: default avatarMatthias Reichl <hias@horus.com>
Signed-off-by: default avatarSean Young <sean@mess.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent aec3eadf
......@@ -1177,6 +1177,11 @@ static void mceusb_process_ir_data(struct mceusb_dev *ir, int buf_len)
init_ir_raw_event(&rawir);
rawir.pulse = ((ir->buf_in[i] & MCE_PULSE_BIT) != 0);
rawir.duration = (ir->buf_in[i] & MCE_PULSE_MASK);
if (unlikely(!rawir.duration)) {
dev_warn(ir->dev, "nonsensical irdata %02x with duration 0",
ir->buf_in[i]);
break;
}
if (rawir.pulse) {
ir->pulse_tunit += rawir.duration;
ir->pulse_count++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment