Re: [PATCH 2/2] net: phy: abort loading yt8511 driver in unsupported modes

From: Andrew Lunn
Date: Tue May 25 2021 - 09:03:58 EST


On Tue, May 25, 2021 at 08:26:15AM -0400, Peter Geis wrote:
> 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: b1b41c047f73 ("net: phy: add driver for Motorcomm yt8511 phy")
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
> Signed-off-by: Peter Geis <pgwipeout@xxxxxxxxx>

Reviewed-by: Andrew Lunn <andrew@xxxxxxx>

Andrew