mirror of
https://github.com/torvalds/linux.git
synced 2026-11-26 08:23:17 +00:00
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: 48e8c6f161 ("net: phy: add driver for Motorcomm yt8511 phy")
Reported-by: kernel test robot <[email protected]>
Reviewed-by: Andrew Lunn <[email protected]>
Signed-off-by: Peter Geis <[email protected]>
Signed-off-by: Jakub Kicinski <[email protected]>