LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* video/tda8290.c: possibly uninitialized variables used
@ 2008-02-27 21:21 Adrian Bunk
  0 siblings, 0 replies; only message in thread
From: Adrian Bunk @ 2008-02-27 21:21 UTC (permalink / raw)
  To: Michael Krufky, Hans Verkuil, Mauro Carvalho Chehab
  Cc: v4l-dvb-maintainer, linux-kernel

drivers/media/video/tda8290.c contains the following code:

<--  snip  -->

...
static void tda8290_set_params(struct dvb_frontend *fe,
                               struct analog_parameters *params)
{
...
        unsigned char adc_sat, agc_stat,
                      pll_stat;
        int i;

        set_audio(fe, params);

        if (priv->cfg.config)
                tuner_dbg("tda827xa config is 0x%02x\n", *priv->cfg.config);
        tuner_i2c_xfer_send(&priv->i2c_props, easy_mode, 2);
        tuner_i2c_xfer_send(&priv->i2c_props, agc_out_on, 2);
        tuner_i2c_xfer_send(&priv->i2c_props, soft_reset, 2);
        msleep(1);

        expert_mode[1] = priv->tda8290_easy_mode + 0x80;
        tuner_i2c_xfer_send(&priv->i2c_props, expert_mode, 2);
        tuner_i2c_xfer_send(&priv->i2c_props, gainset_off, 2);
        tuner_i2c_xfer_send(&priv->i2c_props, if_agc_spd, 2);
        if (priv->tda8290_easy_mode & 0x60)
                tuner_i2c_xfer_send(&priv->i2c_props, adc_head_9, 2);
        else
                tuner_i2c_xfer_send(&priv->i2c_props, adc_head_6, 2);
        tuner_i2c_xfer_send(&priv->i2c_props, pll_bw_nom, 2);

        tda8290_i2c_bridge(fe, 1);

        if (fe->ops.tuner_ops.set_analog_params)
                fe->ops.tuner_ops.set_analog_params(fe, params);

        for (i = 0; i < 3; i++) {
                tuner_i2c_xfer_send(&priv->i2c_props, &addr_pll_stat, 1);
                tuner_i2c_xfer_recv(&priv->i2c_props, &pll_stat, 1);
                if (pll_stat & 0x80) {
                        tuner_i2c_xfer_send(&priv->i2c_props, &addr_adc_sat, 1);
                        tuner_i2c_xfer_recv(&priv->i2c_props, &adc_sat, 1);
                        tuner_i2c_xfer_send(&priv->i2c_props, &addr_agc_stat, 1);
                        tuner_i2c_xfer_recv(&priv->i2c_props, &agc_stat, 1);
                        tuner_dbg("tda8290 is locked, AGC: %d\n", agc_stat);
                        break;
                } else {
                        tuner_dbg("tda8290 not locked, no signal?\n");
                        msleep(100);
                }
        }
        /* adjust headroom resp. gain */
        if ((agc_stat > 115) || (!(pll_stat & 0x80) && (adc_sat < 20))) 
...

<--  snip  -->

When we got four times "tda8290 not locked, no signal?" the variables 
agc_stat and adc_sat are used uninitialized here.

Spotted by the Coverity checker.

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-02-27 21:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-27 21:21 video/tda8290.c: possibly uninitialized variables used Adrian Bunk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).