lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdVPzkgJCPXBbFYc44T4JiyRN+r1nrcd0oPhW0vBy82LoQ@mail.gmail.com>
Date:	Wed, 6 Aug 2014 21:31:02 +0200
From:	Geert Uytterhoeven <geert@...ux-m68k.org>
To:	Mauro Carvalho Chehab <m.chehab@...sung.com>
Cc:	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Linux Media Mailing List <linux-media@...r.kernel.org>
Subject: dib7000p_get_stats: ‘i’ is used uninitialized (was: Re: [media] dib7000p: Add DVBv5 stats support)

Hi Mauro,

On Wed, Aug 6, 2014 at 2:03 AM, Linux Kernel Mailing List
<linux-kernel@...r.kernel.org> wrote:
> Gitweb:     http://git.kernel.org/linus/;a=commit;h=041ad449683bb2d54a7f082d78ec15bbc958a175
> Commit:     041ad449683bb2d54a7f082d78ec15bbc958a175
> Parent:     d44913c1e547df19b2dc0b527f92a4b4354be23a
> Refname:    refs/heads/master
> Author:     Mauro Carvalho Chehab <m.chehab@...sung.com>
> AuthorDate: Thu May 29 14:44:56 2014 -0300
> Committer:  Mauro Carvalho Chehab <m.chehab@...sung.com>
> CommitDate: Tue Jun 17 12:04:50 2014 -0300
>
>     [media] dib7000p: Add DVBv5 stats support
>
>     Adds DVBv5 stats support. For now, just mimic whatever dib8000
>     does, as they're very similar, with regards to statistics.
>
>     However, dib7000p_get_time_us() likely require some
>     adjustments, as I didn't actually reviewed the formula
>     for it to work with DVB-T. Still, better than nothing,
>     as latter patches can improve it.

Yes, it does, as its "layer" parameter is not used....

> diff --git a/drivers/media/dvb-frontends/dib7000p.c b/drivers/media/dvb-frontends/dib7000p.c
> index d36fa0d..c41f90d 100644
> --- a/drivers/media/dvb-frontends/dib7000p.c
> +++ b/drivers/media/dvb-frontends/dib7000p.c

> +/* FIXME: may require changes - this one was borrowed from dib8000 */
> +static u32 dib7000p_get_time_us(struct dvb_frontend *demod, int layer)
> +{

[...]

> +}

> +static int dib7000p_get_stats(struct dvb_frontend *demod, fe_status_t stat)
> +{
> +       struct dib7000p_state *state = demod->demodulator_priv;
> +       struct dtv_frontend_properties *c = &demod->dtv_property_cache;
> +       int i;

[...]

> +       /* Get PER measures */
> +       if (show_per_stats) {
> +               dib7000p_read_unc_blocks(demod, &val);
> +
> +               c->block_error.stat[0].scale = FE_SCALE_COUNTER;
> +               c->block_error.stat[0].uvalue += val;
> +
> +               time_us = dib7000p_get_time_us(demod, i);

drivers/media/dvb-frontends/dib7000p.c: In function ‘dib7000p_get_stats’:
drivers/media/dvb-frontends/dib7000p.c:1972: warning: ‘i’ is used
uninitialized in this function

So far this is harmless, as the "layer" parameter isn't used, but this
deserves some cleanup.

> +               if (time_us) {
> +                       blocks = 1250000ULL * 1000000ULL;
> +                       do_div(blocks, time_us * 8 * 204);
> +                       c->block_count.stat[0].scale = FE_SCALE_COUNTER;
> +                       c->block_count.stat[0].uvalue += blocks;
> +               }
> +       }
> +       return 0;
> +}

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ