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: <14428343.0Jf5tZk0Ep@wuerfel>
Date:   Tue, 25 Oct 2016 22:19:49 +0200
From:   Arnd Bergmann <arnd@...db.de>
To:     David Laight <David.Laight@...lab.com>
Cc:     Solomon Peachy <pizza@...ftnet.org>,
        Kalle Valo <kvalo@...eaurora.org>,
        Johannes Berg <johannes.berg@...el.com>,
        "linux-wireless@...r.kernel.org" <linux-wireless@...r.kernel.org>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] cw1200: fix bogus maybe-uninitialized warning

On Tuesday, October 25, 2016 1:24:55 PM CEST David Laight wrote:
> > diff --git a/drivers/net/wireless/st/cw1200/wsm.c b/drivers/net/wireless/st/cw1200/wsm.c
> > index 680d60eabc75..094e6637ade2 100644
> > --- a/drivers/net/wireless/st/cw1200/wsm.c
> > +++ b/drivers/net/wireless/st/cw1200/wsm.c
> > @@ -385,14 +385,13 @@ static int wsm_multi_tx_confirm(struct cw1200_common *priv,
> >       if (WARN_ON(count <= 0))
> >               return -EINVAL;
> > 
> > -     if (count > 1) {
> > -             /* We already released one buffer, now for the rest */
> > -             ret = wsm_release_tx_buffer(priv, count - 1);
> > -             if (ret < 0)
> > -                     return ret;
> > -             else if (ret > 0)
> > -                     cw1200_bh_wakeup(priv);
> > -     }
> > +     /* We already released one buffer, now for the rest */
> > +     ret = wsm_release_tx_buffer(priv, count - 1);
> > +     if (ret < 0)
> > +             return ret;
> > +
> > +     if (ret > 0)
> > +             cw1200_bh_wakeup(priv);
> 
> That doesn't look equivalent to me (when count == 1).

Ah, that's what I missed, thanks for pointing that out!

> > 
> >       cw1200_debug_txed_multi(priv, count);
> >       for (i = 0; i < count; ++i) {
> 
> Convert this loop into a do ... while so the body executes at least once.

Good idea. Version 2 coming now.

	Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ