diff options
author | Sean Young <sean@mess.org> | 2013-07-30 19:00:00 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2013-08-22 11:45:32 -0300 |
commit | 38e35a85284b9cce271ff43a849d3676a46f8512 (patch) | |
tree | 6352a4acc116f9f01f2a30b03d8a5efbdc9676c6 /drivers/media/rc | |
parent | a354177f058541b7212230feb2c0da7c464e9b9d (diff) | |
download | linux-stable-38e35a85284b9cce271ff43a849d3676a46f8512.tar.gz linux-stable-38e35a85284b9cce271ff43a849d3676a46f8512.tar.bz2 linux-stable-38e35a85284b9cce271ff43a849d3676a46f8512.zip |
[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>
Diffstat (limited to 'drivers/media/rc')
-rw-r--r-- | drivers/media/rc/redrat3.c | 3 |
1 files changed, 2 insertions, 1 deletions
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; |