]> git.baikalelectronics.ru Git - kernel.git/commit
net: phy: fix yt8511 clang uninitialized variable warning
authorPeter Geis <pgwipeout@gmail.com>
Sat, 29 May 2021 11:05:55 +0000 (07:05 -0400)
committerJakub Kicinski <kuba@kernel.org>
Sun, 30 May 2021 21:24:38 +0000 (14:24 -0700)
commit5f6a8f4afb6b92c5624232755b8cd04444bfc87a
tree3226c42f9b2beb73d39d20324753a724b6352fb5
parent69d45677f78c6893083f2e00aa5fc47186d4c9c2
net: phy: fix yt8511 clang uninitialized variable warning

clang doesn't preinitialize variables. If phy_select_page failed and
returned an error, phy_restore_page would be called with `ret` being
uninitialized.
Even though phy_restore_page won't use `ret` in this scenario,
initialize `ret` to silence the warning.

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