net: mvneta: fix locking in mvneta_cpu_online()
PATCH 1/1 net: mvneta: fix locking in mvneta_cpu_online()
When port is stopped, unlock before returning
---
This is based on static analysis, only compile tested
--- drivers/net/ethernet/marvell/mvneta.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/marvell/mvneta.c +1 -0
@@ -4432,6 +4432,7 @@ static int mvneta_cpu_online(unsigned int cpu, struct hlist_node *node)*/ if (pp->is_stopped) {spin_unlock (&pp->lock); +netdev_unlock (port->napi.dev);return 0 ; }netif_tx_stop_all_queues (pp->dev);
Signature · 1 line
2.39.3
Hi,
Quoted 2 lines · Harshit Mogalapalli
When port is stopped, unlock before returning
Missed adding a period at the end of sentence. Should I send a V2 ?
Thanks,
Harshit
Quoted 20 lines
Fixes 413f0271f396 ("net: protect NAPI enablement with netdev_lock()")Signed-off-by Harshit Mogalapalli <[email protected]>---
This is based on static analysis, only compile tested--- drivers/net/ethernet/marvell/mvneta.c | 1 + 1 file changed, 1 insertion(+)drivers/net/ethernet/marvell/mvneta.c +1
-0@@ -4432,6 +4432,7 @@ static int mvneta_cpu_online(unsigned int cpu, struct hlist_node *node)*/ if (pp->is_stopped) {spin_unlock (&pp->lock); +netdev_unlock (port->napi.dev);return 0 ; }netif_tx_stop_all_queues (pp->dev);
Jakub Kicinski
maintainerQuoted 4 lines · On Tue, 21 Jan 2025 06:23:16 +0530 Harshit Mogalapalli wrote:
Quoted 2 lines · Harshit Mogalapalli
When port is stopped, unlock before returning
Missed adding a period at the end of sentence. Should I send a V2 ?
It's alright, we can add the period when applying.
Quoted 6 lines · Harshit Mogalapalli
When port is stopped, unlock before returning
Fixes 413f0271f396 ("net: protect NAPI enablement with netdev_lock()")Signed-off-by Harshit Mogalapalli <[email protected]>---
This is based on static analysis, only compile tested
Thanks Harshit,
I agree that this is correct.
FWIIW, I would have used the idiomatic approach of a goto to jump to nearly the end of the function, but the effect is the same either way.
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 8 lines · On Mon, 20 Jan 2025 16:50:02 -0800 you wrote:
When port is stopped, unlock before returning
Fixes 413f0271f396 ("net: protect NAPI enablement with netdev_lock()")Signed-off-by Harshit Mogalapalli <[email protected]>---
This is based on static analysis, only compile tested[...]
Here is the summary with links:
- net: mvneta: fix locking in mvneta_cpu_online()
https://git.kernel.org/netdev/net/c/59e00e8ca242
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html