diff options
author | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-04-28 19:02:19 -0300 |
---|---|---|
committer | Jiri Slaby <jslaby@suse.cz> | 2015-08-04 16:52:06 +0200 |
commit | d74d53765b952c03a5b36bcac935bc2c4e313650 (patch) | |
tree | ac315dc2308d5716c25d46e383c735433faf95e0 /drivers | |
parent | 7934fe3254792d761bdbb8e10b8e451d1ebc414c (diff) |
af9013: Don't accept invalid bandwidth
commit d7b76c91f471413de9ded837bddeca2164786571 upstream.
If userspace sends an invalid bandwidth, it should either return
EINVAL or switch to auto mode.
This driver will go past an array and program the hardware on a
wrong way if this happens.
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/dvb-frontends/af9013.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/media/dvb-frontends/af9013.c b/drivers/media/dvb-frontends/af9013.c index fb504f1e9125..5930aee6b5d0 100644 --- a/drivers/media/dvb-frontends/af9013.c +++ b/drivers/media/dvb-frontends/af9013.c @@ -606,6 +606,10 @@ static int af9013_set_frontend(struct dvb_frontend *fe) } } + /* Return an error if can't find bandwidth or the right clock */ + if (i == ARRAY_SIZE(coeff_lut)) + return -EINVAL; + ret = af9013_wr_regs(state, 0xae00, coeff_lut[i].val, sizeof(coeff_lut[i].val)); } |