]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Nov 2020 18:22:21 +0000 (19:22 +0100)
[ Upstream commit edbc21113bde13ca3d06eec24b621b1f628583dd ]

When no devicetree is present, the driver will use an
uninitialized variable.

Fix by initializing this variable.

Fixes: 902a66e08cea ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/microchip/lan743x_main.c

index 6c25c7c8b7cf827a8ff4829dd2d9cf0b343c807b..bc368136bccc6de88d7154fc6d388ecc4a1553cb 100644 (file)
@@ -1015,8 +1015,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;