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>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CABvMjLS2ftUgxeKNxQW2npxKRjM3_=U7qg7oYTw6VrkUWcOocw@mail.gmail.com>
Date:   Thu, 7 Feb 2019 09:48:41 -0800
From:   Yizhuo Zhai <yzhai003@....edu>
To:     Maxime Ripard <maxime.ripard@...tlin.com>
Cc:     David Miller <davem@...emloft.net>,
        Chengyu Song <csong@...ucr.edu>,
        Zhiyun Qian <zhiyunq@...ucr.edu>,
        Giuseppe Cavallaro <peppe.cavallaro@...com>,
        Alexandre Torgue <alexandre.torgue@...com>,
        Chen-Yu Tsai <wens@...e.org>, netdev@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: stmmac: Variable "val" in function
 sun8i_dwmac_set_syscon() could be uninitialized

Make sense, I will send the new patch. Thanks for the opinion.

On Thu, Feb 7, 2019 at 1:25 AM Maxime Ripard <maxime.ripard@...tlin.com> wrote:
>
> On Wed, Feb 06, 2019 at 09:53:16PM -0800, Yizhuo Zhai wrote:
> >
> >
> > On Wed, Feb 6, 2019 at 9:52 PM Yizhuo Zhai <yzhai003@....edu> wrote:
> > >
> > > Thanks, but why initialization matters here? Is performance the main concern?
> > >
> > > On Wed, Feb 6, 2019 at 8:17 PM David Miller <davem@...emloft.net> wrote:
> > >>
> > >> From: Yizhuo <yzhai003@....edu>
> > >> Date: Tue,  5 Feb 2019 14:15:59 -0800
> > >>
> > >> > @@ -639,9 +639,14 @@ static int sun8i_dwmac_set_syscon(struct stmmac_priv *priv)
> > >> >       struct sunxi_priv_data *gmac = priv->plat->bsp_priv;
> > >> >       struct device_node *node = priv->device->of_node;
> > >> >       int ret;
> > >> > -     u32 reg, val;
> > >> > +     u32 reg, val = 0;
> > >> > +
> > >> > +     ret = regmap_read(gmac->regmap, SYSCON_EMAC_REG, &val);
> > >> > +     if (ret) {
> > >> > +             dev_err(priv->device, "Fail to read SYSCON_EMAC_REG.\n");
> > >> > +             return ret;
> > >> > +     }
> > >>
> > >> I agree with the other reviewer that since you check 'ret' the initialization of
> > >> 'val' is no longer needed.
> >
> > Thanks, but why initialization matters here? Is performance the main
> > concern?
>
> Not really, but if we turn this the other way around, why should we do
> something that doesn't bring anything?
>
> Maxime
>
> --
> Maxime Ripard, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com



-- 
Kind Regards,

Yizhuo Zhai

Computer Science, Graduate Student
University of California, Riverside

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ