lkml.org 
[lkml]   [2020]   [Jul]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subjectre: net: phy: continue searching for C45 MMDs even if first returned ffff:ffff
Date
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@nxp.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

\
 
 \ /
  Last update: 2020-07-20 18:22    [W:0.052 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site