From: Sean Young Date: Tue, 30 Jul 2013 22:00:00 +0000 (-0300) Subject: [media] redrat3: ensure whole packet is read X-Git-Tag: firefly_0821_release~176^2~3573^2~1404 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=38e35a85284b9cce271ff43a849d3676a46f8512;p=firefly-linux-kernel-4.4.55.git [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 Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/rc/redrat3.c b/drivers/media/rc/redrat3.c index 0042367b060c..ccd267f131fa 100644 --- a/drivers/media/rc/redrat3.c +++ b/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;