提交 d4589935 编写于 作者: S Sean Young 提交者: 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: NMatthias Reichl <hias@horus.com>
Signed-off-by: NSean Young <sean@mess.org>
Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
新手
引导
客服 返回
顶部