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: Matthias Reichl <hias@horus.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
This commit is contained in:
parent
aec3eadfb6
commit
d4589935eb
|
@ -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++;
|
||||
|
|
Loading…
Reference in a new issue