dvb_frontend_swzigzag(): uninitialized variable usage

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The Coverity checker spotted the following in 
drivers/media/dvb/dvb-core/dvb_frontend.c:

<--  snip  -->

...
static void dvb_frontend_swzigzag(struct dvb_frontend *fe)
{
        fe_status_t s;
        struct dvb_frontend_private *fepriv = fe->frontend_priv;

        /* if we've got no parameters, just keep idling */
        if (fepriv->state & FESTATE_IDLE) {
                fepriv->delay = 3*HZ;
                fepriv->quality = 0;
                return;
        }

        /* in SCAN mode, we just set the frontend when asked and leave it alone */
        if (fepriv->tune_mode_flags & FE_TUNE_MODE_ONESHOT) {
                if (fepriv->state & FESTATE_RETUNE) {
                        if (fe->ops.set_frontend)
                                fe->ops.set_frontend(fe, &fepriv->parameters);
                        fepriv->state = FESTATE_TUNED;
                }
                fepriv->delay = 3*HZ;
                fepriv->quality = 0;
                return;
        }

        /* get the frontend status */
        if (fepriv->state & FESTATE_RETUNE) {
                s = 0;
        } else {
                if (fe->ops.read_status)
                        fe->ops.read_status(fe, &s);
                if (s != fepriv->status) {
                        dvb_frontend_add_event(fe, s);
                        fepriv->status = s;
                }
        }
...

<--  snip  -->

Note that in the "if (s != fepriv->status)", "s" could be used 
uninitialized.

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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux