[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <4131864f-9e3e-9814-5f4d-16c93648bce2@canonical.com>
Date: Mon, 20 Jul 2020 17:21:13 +0100
From: Colin Ian King <colin.king@...onical.com>
To: Vladimir Oltean <vladimir.oltean@....com>,
Andrew Lunn <andrew@...n.ch>,
Florian Fainelli <f.fainelli@...il.com>,
Heiner Kallweit <hkallweit1@...il.com>,
Russell King <linux@...linux.org.uk>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>, netdev@...r.kernel.org
Cc: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: re: net: phy: continue searching for C45 MMDs even if first returned
ffff:ffff
Hi,
Static analysis by Coverity has found a potential issue with the
following commit in /drivers/net/phy/phy_device.c:
commit bba238ed037c60242332dd1e4c5778af9eba4d9b
Author: Vladimir Oltean <vladimir.oltean@....com>
Date: Sun Jul 12 19:48:15 2020 +0300
net: phy: continue searching for C45 MMDs even if first returned
ffff:ffff
The analysis is as follows:
735 * for 802.3 c45 complied PHYs, so don't probe it at first.
736 */
dead_error_condition: The condition (devs_in_pkg & 0x1fffffffU) ==
0x1fffffffU cannot be true.
737 for (i = 1; i < MDIO_MMD_NUM && devs_in_pkg == 0 &&
const: At condition (devs_in_pkg & 0x1fffffffU) == 0x1fffffffU, the
value of devs_in_pkg must be equal to 0.
738 (devs_in_pkg & 0x1fffffff) == 0x1fffffff; i++) {
Logically dead code (DEADCODE)dead_error_line: Execution cannot reach
this statement: if (i == 30 || i == 31) {
To summarize, if devs_in_pkg is zero, then (devs_in_pkg & 0x1fffffffU)
== 0x1fffffffU can never be true, so the loop is never iterated over.
Colin
Powered by blists - more mailing lists