net: txgbe: leave space for null terminators on property_entry
Subsystems (3)
PATCH 1/1 net: txgbe: leave space for null terminators on property_entry
Lists of struct property_entry are supposed to be terminated with an empty property, this driver currently seems to be allocating exactly the amount of entry used.
Change the struct definition to leave an extra element for all property_entry.
---
Hi, bumped into this while studying the code, looks like the struct has been allocated without space for terminators, guess the top ones just end up using the bottom props as well but I'm surprised this does not crash at some point. Build test only, don't have any hardware for this, let me know if I'm missing something here.
Cheers,
Fabio
drivers/net/ethernet/wangxun/txgbe/txgbe_type.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/ethernet/wangxun/txgbe/txgbe_type.h +4 -4
@@ -424,10 +424,10 @@ struct txgbe_nodes {char i2c_name[32 ];char sfp_name[32 ];char phylink_name[32 ]; -struct property_entry gpio_props[1 ]; -struct property_entry i2c_props[3 ]; -struct property_entry sfp_props[8 ]; -struct property_entry phylink_props[2 ]; +struct property_entry gpio_props[2 ]; +struct property_entry i2c_props[4 ]; +struct property_entry sfp_props[9 ]; +struct property_entry phylink_props[3 ];struct software_node_ref_args i2c_ref[1 ];struct software_node_ref_args gpio0_ref[1 ];struct software_node_ref_args gpio1_ref[1 ];
Signature · 1 line
2.47.3
Quoted 42 lines
Lists of struct
property_entryare supposed to be terminated with an empty property, this driver currently seems to be allocating exactly the amount of entry used.Change the struct definition to leave an extra element for all
property_entry.Signed-off-by Fabio Baltieri <[email protected]>---
Hi, bumped into this while studying the code, looks like the struct has been allocated without space for terminators, guess the top ones just end up using the bottom props as well but I'm surprised this does not crash at some point. Build test only, don't have any hardware for this, let me know if I'm missing something here.
Cheers,
Fabiodrivers/net/ethernet/wangxun/txgbe/txgbe_type.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)drivers/net/ethernet/wangxun/txgbe/txgbe_type.h +4
-5@@ -424,10 +424,10 @@ struct txgbe_nodes {char i2c_name[32 ];char sfp_name[32 ];char phylink_name[32 ]; -struct property_entry gpio_props[1 ]; -struct property_entry i2c_props[3 ]; -struct property_entry sfp_props[8 ]; -struct property_entry phylink_props[2 ]; +struct property_entry gpio_props[2 ]; +struct property_entry i2c_props[4 ]; +struct property_entry sfp_props[9 ]; +struct property_entry phylink_props[3 ];struct software_node_ref_args i2c_ref[1 ];struct software_node_ref_args gpio0_ref[1 ];struct software_node_ref_args gpio1_ref[1 ]; --
Quoted 1 line
2.47.3
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 Sun, 5 Apr 2026 23:20:13 +0100 you wrote:
Lists of struct
property_entryare supposed to be terminated with an empty property, this driver currently seems to be allocating exactly the amount of entry used.Change the struct definition to leave an extra element for all
property_entry.[...]
Here is the summary with links:
- net: txgbe: leave space for null terminators on property_entry
https://git.kernel.org/netdev/net/c/5a37d228799b
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html