aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2011-03-06 08:40:11 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-03-22 15:37:50 -0400
commitbf512b2d9c39af31507f485b15b9b40e2a5c499c (patch)
tree3c20af1f2e83529d76d63bd90888eef673090036
parentc6384c886dfed806f07ae2f8ba4d3740b57cde9c (diff)
[media] stv0367: signedness bug in stv0367_get_tuner_freq()
We use err to store negative error codes so it should be signed. And if we return an error from stv0367_get_tuner_freq() that needs to be handled properly as well. (param->frequency is a u32). Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/dvb/frontends/stv0367.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/dvb/frontends/stv0367.c b/drivers/media/dvb/frontends/stv0367.c
index 120fed8229a8..0ddcf7e76704 100644
--- a/drivers/media/dvb/frontends/stv0367.c
+++ b/drivers/media/dvb/frontends/stv0367.c
@@ -913,7 +913,7 @@ static u32 stv0367_get_tuner_freq(struct dvb_frontend *fe)
913 struct dvb_frontend_ops *frontend_ops = NULL; 913 struct dvb_frontend_ops *frontend_ops = NULL;
914 struct dvb_tuner_ops *tuner_ops = NULL; 914 struct dvb_tuner_ops *tuner_ops = NULL;
915 u32 freq = 0; 915 u32 freq = 0;
916 u32 err = 0; 916 int err = 0;
917 917
918 dprintk("%s:\n", __func__); 918 dprintk("%s:\n", __func__);
919 919
@@ -1940,7 +1940,7 @@ static int stv0367ter_get_frontend(struct dvb_frontend *fe,
1940 int constell = 0,/* snr = 0,*/ Data = 0; 1940 int constell = 0,/* snr = 0,*/ Data = 0;
1941 1941
1942 param->frequency = stv0367_get_tuner_freq(fe); 1942 param->frequency = stv0367_get_tuner_freq(fe);
1943 if (param->frequency < 0) 1943 if ((int)param->frequency < 0)
1944 param->frequency = c->frequency; 1944 param->frequency = c->frequency;
1945 1945
1946 constell = stv0367_readbits(state, F367TER_TPS_CONST); 1946 constell = stv0367_readbits(state, F367TER_TPS_CONST);