lan743x: fix use of uninitialized variable
Subsystems (3)
PATCH 1/1 lan743x: fix use of uninitialized variable
From: Sven Van Asbroeck <[email protected]>
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 <[email protected]>
Signed-off-by Sven Van Asbroeck <[email protected]>
---
Tree: git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git # 52755b66ddce
To: Jakub Kicinski <[email protected]>
To: Bryan Whitehead <[email protected]>
To: "David S. Miller" <[email protected]>
Cc: Microchip Linux Driver Support <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: [email protected]
Cc: [email protected]
drivers/net/ethernet/microchip/lan743x_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/microchip/lan743x_main.c +1 -1
@@ -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 ;
Signature · 1 line
2.17.1
Quoted 10 lines · On Thu, 12 Nov 2020 10:25:13 -0500 Sven Van Asbroeck wrote:
From: Sven Van Asbroeck <[email protected]>
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 <[email protected]>Signed-off-by Sven Van Asbroeck <[email protected]>
Applied, thanks!