]> git.baikalelectronics.ru Git - kernel.git/commit
net: phy: abort loading yt8511 driver in unsupported modes
authorPeter Geis <pgwipeout@gmail.com>
Sat, 29 May 2021 11:05:56 +0000 (07:05 -0400)
committerJakub Kicinski <kuba@kernel.org>
Sun, 30 May 2021 21:24:38 +0000 (14:24 -0700)
commitc05cc5293e15684bb50a8f8ca1bab0477c2187d4
tree2f6316473747920bdcaf82e9f398751838b97bcd
parent5f6a8f4afb6b92c5624232755b8cd04444bfc87a
net: phy: abort loading yt8511 driver in unsupported modes

While investigating the clang `ge` uninitialized variable report, it was
discovered the default switch would have unintended consequences. Due to
the switch to __phy_modify, the driver would modify the ID values in the
default scenario.

Fix this by promoting the interface mode switch and aborting when the
mode is not a supported RGMII mode.

This prevents the `ge` and `fe` variables from ever being used
uninitialized.

Fixes: 115dfbd7b9b9 ("net: phy: add driver for Motorcomm yt8511 phy")
Reported-by: kernel test robot <lkp@intel.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Peter Geis <pgwipeout@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/phy/motorcomm.c