Skip to contentSkip to conversation

stmmac: dwmac-loongson: fix uninitialized variable in loongson_dwmac_probe()

PATCH Applied Dan Carpenter 2 participants 2 messages Jun 22, 2021

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 stmmac: dwmac-loongson: fix uninitialized variable in loongson_dwmac_probe()

The "mdio" variable is never set to false. Also it should be a bool type instead of int.

Fixes 30bba69d7db4 ("stmmac: pci: Add dwmac support for Loongson")
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c +2 -1
index 8cd4e2e8ec40..e108b0d2bd28 100644
@@ -49,7 +49,8 @@ static int loongson_dwmac_probe(struct pci_dev *pdev, const struct pci_device_id
 {
 	struct plat_stmmacenet_data *plat;
 	struct stmmac_resources res;
-	int ret, i, mdio;
+	bool mdio = false;
+	int ret, i;
 	struct device_node *np;
 
 	np = dev_of_node(&pdev->dev);
Signature · 1 line
2.30.2
#1 lore raw
This patch was applied to netdev/net-next.git (refs/heads/master):

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

Quoted 8 lines · On Tue, 22 Jun 2021 14:51:43 +0300 you wrote:

The "mdio" variable is never set to false. Also it should be a bool type instead of int.

Fixes 30bba69d7db4 ("stmmac: pci: Add dwmac support for Loongson")
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Here is the summary with links:
- [net-next] stmmac: dwmac-loongson: fix uninitialized variable in loongson_dwmac_probe()

    https://git.kernel.org/netdev/net-next/c/b0e03950dd71

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html