]> git.baikalelectronics.ru Git - kernel.git/commitdiff
lan743x: fix use of uninitialized variable
authorSven Van Asbroeck <thesven73@gmail.com>
Thu, 12 Nov 2020 15:25:13 +0000 (10:25 -0500)
committerJakub Kicinski <kuba@kernel.org>
Thu, 12 Nov 2020 18:03:16 +0000 (10:03 -0800)
When no devicetree is present, the driver will use an
uninitialized variable.

Fix by initializing this variable.

Fixes: d0fcb0ee2abd ("lan743x: correctly handle chips with internal PHY")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Sven Van Asbroeck <thesven73@gmail.com>
Link: https://lore.kernel.org/r/20201112152513.1941-1-TheSven73@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/microchip/lan743x_main.c

index 173158656559d76db2435365177e554c3a1b4b14..e2c99d909247700cbb9e390909c8676b2e5f241a 100644 (file)
@@ -1014,8 +1014,8 @@ static void lan743x_phy_close(struct lan743x_adapter *adapter)
 static int lan743x_phy_open(struct lan743x_adapter *adapter)
 {
        struct lan743x_phy *phy = &adapter->phy;
+       struct phy_device *phydev = NULL;
        struct device_node *phynode;
-       struct phy_device *phydev;
        struct net_device *netdev;
        int ret = -EIO;