linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net v1] lan743x: fix use of uninitialized variable
@ 2020-11-12 15:25 Sven Van Asbroeck
  2020-11-12 18:05 ` Jakub Kicinski
  0 siblings, 1 reply; 2+ messages in thread
From: Sven Van Asbroeck @ 2020-11-12 15:25 UTC (permalink / raw)
  To: Jakub Kicinski, Bryan Whitehead, David S Miller
  Cc: Sven Van Asbroeck, Microchip Linux Driver Support, Andrew Lunn,
	netdev, linux-kernel

From: Sven Van Asbroeck <thesven73@gmail.com>

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>
---
Tree: git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git # 52755b66ddce

To: Jakub Kicinski <kuba@kernel.org>
To: Bryan Whitehead <bryan.whitehead@microchip.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: Microchip Linux Driver Support <UNGLinuxDriver@microchip.com>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org

 drivers/net/ethernet/microchip/lan743x_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/microchip/lan743x_main.c b/drivers/net/ethernet/microchip/lan743x_main.c
index 54d721ef3084..0c9b938ee0ea 100644
--- a/drivers/net/ethernet/microchip/lan743x_main.c
+++ b/drivers/net/ethernet/microchip/lan743x_main.c
@@ -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;
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net v1] lan743x: fix use of uninitialized variable
  2020-11-12 15:25 [PATCH net v1] lan743x: fix use of uninitialized variable Sven Van Asbroeck
@ 2020-11-12 18:05 ` Jakub Kicinski
  0 siblings, 0 replies; 2+ messages in thread
From: Jakub Kicinski @ 2020-11-12 18:05 UTC (permalink / raw)
  To: Sven Van Asbroeck
  Cc: Bryan Whitehead, David S Miller, Microchip Linux Driver Support,
	Andrew Lunn, netdev, linux-kernel

On Thu, 12 Nov 2020 10:25:13 -0500 Sven Van Asbroeck wrote:
> From: Sven Van Asbroeck <thesven73@gmail.com>
> 
> 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>

Applied, thanks!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-11-12 18:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-12 15:25 [PATCH net v1] lan743x: fix use of uninitialized variable Sven Van Asbroeck
2020-11-12 18:05 ` Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).