Skip to content

Commit

Permalink
[media] redrat3: ensure whole packet is read
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sean Young authored and Mauro Carvalho Chehab committed Aug 22, 2013
1 parent a354177 commit 38e35a8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/media/rc/redrat3.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 38e35a8

Please sign in to comment.