diff options
author | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2014-02-28 03:04:08 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-02-28 19:21:02 +0100 |
commit | b59de95bed526467f21c9978460cb15952b462e8 (patch) | |
tree | 4454efcef3de842cf54c5c8eac91dab50c8a3765 /drivers/media/dvb-frontends/ds3000.c | |
parent | [media] stb6100: fix buffer length check in stb6100_write_reg_range() (diff) | |
download | linux-b59de95bed526467f21c9978460cb15952b462e8.tar.xz linux-b59de95bed526467f21c9978460cb15952b462e8.zip |
[media] ds3000: fix reading array out of bound in ds3000_read_snr
An attempt was made to read dvbs2_snr_tab[80],
though dvbs2_snr_tab has only 80 elements.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/dvb-frontends/ds3000.c')
-rw-r--r-- | drivers/media/dvb-frontends/ds3000.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/dvb-frontends/ds3000.c b/drivers/media/dvb-frontends/ds3000.c index 1e344b033277..335daeff91b9 100644 --- a/drivers/media/dvb-frontends/ds3000.c +++ b/drivers/media/dvb-frontends/ds3000.c @@ -616,7 +616,7 @@ static int ds3000_read_snr(struct dvb_frontend *fe, u16 *snr) snr_reading = dvbs2_noise_reading / tmp; if (snr_reading > 80) snr_reading = 80; - *snr = -(dvbs2_snr_tab[snr_reading] / 1000); + *snr = -(dvbs2_snr_tab[snr_reading - 1] / 1000); } dprintk("%s: raw / cooked = 0x%02x / 0x%04x\n", __func__, snr_reading, *snr); |