瀏覽代碼

[media] redrat3: ensure whole packet is read

The length in the header excludes the header itself, so we're getting
spurious readings.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Sean Young 12 年之前
父節點
當前提交
38e35a8528
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      drivers/media/rc/redrat3.c

+ 2 - 1
drivers/media/rc/redrat3.c

@@ -663,7 +663,8 @@ static int redrat3_get_ir_data(struct redrat3_dev *rr3, unsigned len)
 		goto out;
 	}
 
-	if (rr3->bytes_read < be16_to_cpu(rr3->irdata.header.length))
+	if (rr3->bytes_read < be16_to_cpu(rr3->irdata.header.length) +
+						sizeof(struct redrat3_header))
 		/* we're still accumulating data */
 		return 0;