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] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 20 Sep 2022 02:05:17 +0200
From:   Andrew Lunn <andrew@...n.ch>
To:     Vladimir Oltean <vladimir.oltean@....com>
Cc:     "mattias.forsblad@...il.com" <mattias.forsblad@...il.com>,
        netdev <netdev@...r.kernel.org>,
        Florian Fainelli <f.fainelli@...il.com>,
        Christian Marangi <ansuelsmth@...il.com>
Subject: Re: [PATCH rfc v0 6/9] net: dsa: qca8k: Refactor sequence number
 mismatch to use error code

> > -	if (!ack)
> > -		return -EINVAL;
> > +	if (err)
> > +		return -ret;
> 
> Probably "if (err) return -ret" is not what you intend. We know ret is 0,
> we just checked for it earlier.

Good catch. Thanks.

> 
> Also, maybe a variable named "match" would be more expressive? This
> shows how easy it is to make mistakes, mixing "err" with "ret" in the
> same function.

A lot of this code gets removed in the next patch. I'm just trying to
keep to lots of small, easy to review patches, which in this case
results in some not so nice intermediary state, but the next patch
cleans it up.

       Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ