net: mv643xx: fix OF node refcount
PATCH RESEND 1/1 net: mv643xx: fix OF node refcount
Platform devices created with platform_device_alloc() call platform_device_release() when the last reference to the device's kobject is dropped. This function calls of_node_put() unconditionally. This works fine for devices created with platform_device_register_full() but users of the split approach (platform_device_alloc() + platform_device_add()) must bump the reference of the of_node they assign manually. Add the missing call to of_node_get().
---
Resending separately as requested by Jakub
drivers/net/ethernet/marvell/mv643xx_eth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/marvell/mv643xx_eth.c +1 -1
@@ -2780,7 +2780,7 @@ static int mv643xx_eth_shared_of_add_port(struct platform_device *pdev, goto put_err; } ppdev->dev.coherent_dma_mask =DMA_BIT_MASK (32 ); - ppdev->dev.of_node = pnp; + ppdev->dev.of_node =of_node_get (pnp); ret =platform_device_add_resources (ppdev, &res,1 );if (ret)
Signature · 1 line
2.47.3
Jakub Kicinski
maintainerQuoted 7 lines · On Tue, 2 Jun 2026 09:34:14 +0200 Bartosz Golaszewski wrote:
Platform devices created with
platform_device_alloc()callplatform_device_release()when the last reference to the device's kobject is dropped. This function callsof_node_put()unconditionally. This works fine for devices created withplatform_device_register_full()but users of the split approach (platform_device_alloc()+platform_device_add()) must bump the reference of theof_nodethey assign manually. Add the missing call toof_node_get().
Where is it released? I think it's important to note, I can amend the commit message if needed..
Jakub Kicinski
maintainerQuoted 11 lines · On Thu, 4 Jun 2026 08:34:30 -0700 Jakub Kicinski wrote:
Quoted 7 lines · On Tue, 2 Jun 2026 09:34:14 +0200 Bartosz Golaszewski wrote:
Platform devices created with
platform_device_alloc()callplatform_device_release()when the last reference to the device's kobject is dropped. This function callsof_node_put()unconditionally. This works fine for devices created withplatform_device_register_full()but users of the split approach (platform_device_alloc()+platform_device_add()) must bump the reference of theof_nodethey assign manually. Add the missing call toof_node_get().Where is it released? I think it's important to note, I can amend the commit message if needed..
Not enough coffee in the morning I guess.
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 9 lines · On Tue, 2 Jun 2026 09:34:14 +0200 you wrote:
Platform devices created with
platform_device_alloc()callplatform_device_release()when the last reference to the device's kobject is dropped. This function callsof_node_put()unconditionally. This works fine for devices created withplatform_device_register_full()but users of the split approach (platform_device_alloc()+platform_device_add()) must bump the reference of theof_nodethey assign manually. Add the missing call toof_node_get().[...]
Here is the summary with links:
- [RESEND,net] net: mv643xx: fix OF node refcount
https://git.kernel.org/netdev/net/c/4aacf509e537
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html