Netdev Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] net: stmmac: Fix missing spin_lock_init in visconti_eth_dwmac_probe()
@ 2021-02-23 10:48 Wei Yongjun
  2021-02-23 23:11 ` Nobuhiro Iwamatsu
  2021-02-25  0:20 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Wei Yongjun @ 2021-02-23 10:48 UTC (permalink / raw)
  To: Hulk Robot, Giuseppe Cavallaro, Alexandre Torgue, Jose Abreu,
	Jakub Kicinski, Nobuhiro Iwamatsu, Maxime Coquelin
  Cc: Wei Yongjun, netdev, linux-stm32, linux-arm-kernel

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 <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 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;


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

* Re: [PATCH] net: stmmac: Fix missing spin_lock_init in visconti_eth_dwmac_probe()
  2021-02-23 10:48 [PATCH] net: stmmac: Fix missing spin_lock_init in visconti_eth_dwmac_probe() Wei Yongjun
@ 2021-02-23 23:11 ` Nobuhiro Iwamatsu
  2021-02-25  0:20 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Nobuhiro Iwamatsu @ 2021-02-23 23:11 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: Hulk Robot, Giuseppe Cavallaro, Alexandre Torgue, Jose Abreu,
	Jakub Kicinski, Maxime Coquelin, netdev, linux-stm32,
	linux-arm-kernel

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 <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Thanks for your fix.

Acked-by: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>

> ---
>  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

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

* Re: [PATCH] net: stmmac: Fix missing spin_lock_init in visconti_eth_dwmac_probe()
  2021-02-23 10:48 [PATCH] net: stmmac: Fix missing spin_lock_init in visconti_eth_dwmac_probe() Wei Yongjun
  2021-02-23 23:11 ` Nobuhiro Iwamatsu
@ 2021-02-25  0:20 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-02-25  0:20 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: hulkci, peppe.cavallaro, alexandre.torgue, joabreu, kuba,
	nobuhiro1.iwamatsu, mcoquelin.stm32, netdev, linux-stm32,
	linux-arm-kernel

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 <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> 
> [...]

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



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

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-23 10:48 [PATCH] net: stmmac: Fix missing spin_lock_init in visconti_eth_dwmac_probe() Wei Yongjun
2021-02-23 23:11 ` Nobuhiro Iwamatsu
2021-02-25  0:20 ` patchwork-bot+netdevbpf

Netdev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/netdev/0 netdev/git/0.git
	git clone --mirror https://lore.kernel.org/netdev/1 netdev/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 netdev netdev/ https://lore.kernel.org/netdev \
		netdev@vger.kernel.org
	public-inbox-index netdev

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.netdev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git