projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
155af08
)
[media] ds3000: return error if invalid symbol rate is set
author
Olli Salonen
<
[email protected]
>
Wed, 16 Mar 2016 11:04:51 +0000
(08:04 -0300)
committer
Mauro Carvalho Chehab
<
[email protected]
>
Tue, 7 Jun 2016 20:10:04 +0000
(17:10 -0300)
Return -EINVAL if ds3000_set_frontend is called with invalid parameters.
v1 of the patch series got incorrect subject lines.
Signed-off-by: Olli Salonen <
[email protected]
>
Signed-off-by: Mauro Carvalho Chehab <
[email protected]
>
drivers/media/dvb-frontends/ds3000.c
patch
|
blob
|
history
diff --git
a/drivers/media/dvb-frontends/ds3000.c
b/drivers/media/dvb-frontends/ds3000.c
index addffc33993a9dc234e479ac0f55d91d536eeed1..447b518e287a305b0749c1a6128cea6232f3f1a6 100644
(file)
--- a/
drivers/media/dvb-frontends/ds3000.c
+++ b/
drivers/media/dvb-frontends/ds3000.c
@@
-959,6
+959,15
@@
static int ds3000_set_frontend(struct dvb_frontend *fe)
/* enable ac coupling */
ds3000_writereg(state, 0x25, 0x8a);
+ if ((c->symbol_rate < ds3000_ops.info.symbol_rate_min) ||
+ (c->symbol_rate > ds3000_ops.info.symbol_rate_max)) {
+ dprintk("%s() symbol_rate %u out of range (%u ... %u)\n",
+ __func__, c->symbol_rate,
+ ds3000_ops.info.symbol_rate_min,
+ ds3000_ops.info.symbol_rate_max);
+ return -EINVAL;
+ }
+
/* enhance symbol rate performance */
if ((c->symbol_rate / 1000) <= 5000) {
value = 29777 / (c->symbol_rate / 1000) + 1;