netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* net: pxa168_eth: Fix a potential data race in pxa168_eth_remove
@ 2021-06-18  9:35 Pavel Machek
  2021-06-18 19:20 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Pavel Machek @ 2021-06-18  9:35 UTC (permalink / raw)
  To: davem
  Cc: Jakub Kicinski, Zhang Changzhong, Pavel Andrianov, Michael Walle,
	Andrew Lunn, netdev, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1309 bytes --]

Commit 0571a753cb07 cancelled delayed work too late, keeping small
race. Cancel work sooner to close it completely.
    
Signed-off-by: Pavel Machek (CIP) <pavel@denx.de>
Fixes: 0571a753cb07 ("net: pxa168_eth: Fix a potential data race in pxa168_eth_remove")
    
diff --git a/drivers/net/ethernet/marvell/pxa168_eth.c b/drivers/net/ethernet/marvell/pxa168_eth.c
index e967867828d8..9b48ae4bac39 100644
--- a/drivers/net/ethernet/marvell/pxa168_eth.c
+++ b/drivers/net/ethernet/marvell/pxa168_eth.c
@@ -1528,6 +1528,7 @@ static int pxa168_eth_remove(struct platform_device *pdev)
 	struct net_device *dev = platform_get_drvdata(pdev);
 	struct pxa168_eth_private *pep = netdev_priv(dev);
 
+	cancel_work_sync(&pep->tx_timeout_task);
 	if (pep->htpr) {
 		dma_free_coherent(pep->dev->dev.parent, HASH_ADDR_TABLE_SIZE,
 				  pep->htpr, pep->htpr_dma);
@@ -1539,7 +1540,6 @@ static int pxa168_eth_remove(struct platform_device *pdev)
 	clk_disable_unprepare(pep->clk);
 	mdiobus_unregister(pep->smi_bus);
 	mdiobus_free(pep->smi_bus);
-	cancel_work_sync(&pep->tx_timeout_task);
 	unregister_netdev(dev);
 	free_netdev(dev);
 	return 0;

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

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

* Re: net: pxa168_eth: Fix a potential data race in pxa168_eth_remove
  2021-06-18  9:35 net: pxa168_eth: Fix a potential data race in pxa168_eth_remove Pavel Machek
@ 2021-06-18 19:20 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-06-18 19:20 UTC (permalink / raw)
  To: Pavel Machek
  Cc: davem, kuba, zhangchangzhong, andrianov, michael, andrew, netdev,
	linux-kernel

Hello:

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

On Fri, 18 Jun 2021 11:35:26 +0200 you wrote:
> Commit 0571a753cb07 cancelled delayed work too late, keeping small
> race. Cancel work sooner to close it completely.
> 
> Signed-off-by: Pavel Machek (CIP) <pavel@denx.de>
> Fixes: 0571a753cb07 ("net: pxa168_eth: Fix a potential data race in pxa168_eth_remove")

Here is the summary with links:
  - net: pxa168_eth: Fix a potential data race in pxa168_eth_remove
    https://git.kernel.org/netdev/net-next/c/bd70957438f0

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] 2+ messages in thread

end of thread, other threads:[~2021-06-18 19:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-18  9:35 net: pxa168_eth: Fix a potential data race in pxa168_eth_remove Pavel Machek
2021-06-18 19:20 ` patchwork-bot+netdevbpf

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