[PATCH] net: stmmac: Fix missing spin_lock_init in visconti_eth_dwmac_probe()

Subsystems: arm/toshiba visconti architecture, networking drivers, stmmac ethernet driver, the rest

STALE1984d LANDED

Landed in mainline as 17d7fd47aa90 on 2021-02-25.

3 messages, 3 authors, 2021-02-25 · open the first message on its own page

[PATCH] net: stmmac: Fix missing spin_lock_init in visconti_eth_dwmac_probe()

From: Wei Yongjun <hidden>
Date: 2021-02-23 10:40:39

The driver allocates the spinlock but not initialize it.
Use spin_lock_init() on it to initialize it correctly.

Fixes: b38dd98ff8d0 ("net: stmmac: Add Toshiba Visconti SoCs glue driver")
Reported-by: Hulk Robot <redacted>
Signed-off-by: Wei Yongjun <redacted>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-visconti.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-visconti.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-visconti.c
index b7a0c57dfbfb..d23be45a64e5 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-visconti.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-visconti.c
@@ -218,6 +218,7 @@ static int visconti_eth_dwmac_probe(struct platform_device *pdev)
 		goto remove_config;
 	}
 
+	spin_lock_init(&dwmac->lock);
 	dwmac->reg = stmmac_res.addr;
 	plat_dat->bsp_priv = dwmac;
 	plat_dat->fix_mac_speed = visconti_eth_fix_mac_speed;

Re: [PATCH] net: stmmac: Fix missing spin_lock_init in visconti_eth_dwmac_probe()

From: Nobuhiro Iwamatsu <hidden>
Date: 2021-02-23 23:13:59

Hi,

On Tue, Feb 23, 2021 at 10:48:03AM +0000, Wei Yongjun wrote:
The driver allocates the spinlock but not initialize it.
Use spin_lock_init() on it to initialize it correctly.

Fixes: b38dd98ff8d0 ("net: stmmac: Add Toshiba Visconti SoCs glue driver")
Reported-by: Hulk Robot <redacted>
Signed-off-by: Wei Yongjun <redacted>
Thanks for your fix.

Acked-by: Nobuhiro Iwamatsu <redacted>
quoted hunk
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-visconti.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-visconti.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-visconti.c
index b7a0c57dfbfb..d23be45a64e5 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-visconti.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-visconti.c
@@ -218,6 +218,7 @@ static int visconti_eth_dwmac_probe(struct platform_device *pdev)
 		goto remove_config;
 	}
 
+	spin_lock_init(&dwmac->lock);
 	dwmac->reg = stmmac_res.addr;
 	plat_dat->bsp_priv = dwmac;
 	plat_dat->fix_mac_speed = visconti_eth_fix_mac_speed;
Best regards,
  Nobuhiro

Re: [PATCH] net: stmmac: Fix missing spin_lock_init in visconti_eth_dwmac_probe()

From: patchwork-bot+netdevbpf@kernel.org
Date: 2021-02-25 00:22:08

Hello:

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

On Tue, 23 Feb 2021 10:48:03 +0000 you wrote:
The driver allocates the spinlock but not initialize it.
Use spin_lock_init() on it to initialize it correctly.

Fixes: b38dd98ff8d0 ("net: stmmac: Add Toshiba Visconti SoCs glue driver")
Reported-by: Hulk Robot <redacted>
Signed-off-by: Wei Yongjun <redacted>

[...]
Here is the summary with links:
  - net: stmmac: Fix missing spin_lock_init in visconti_eth_dwmac_probe()
    https://git.kernel.org/netdev/net/c/17d7fd47aa90

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

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help