Skip to contentSkip to conversation

net: pcs: xpcs: fix incorrect number of interfaces

PATCH Applied Russell King (Oracle) 4 participants 4 messages May 9, 2023 – May 10, 2023

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: pcs: xpcs: fix incorrect number of interfaces

In synopsys_xpcs_compat[], the DW_XPCS_2500BASEX entry was setting the number of interfaces using the xpcs_2500basex_features array rather than xpcs_2500basex_interfaces. This causes us to overflow the array of interfaces. Fix this.

Fixes f27abde3042a ("net: pcs: add 2500BASEX support for Intel mGbE controller")
---
 drivers/net/pcs/pcs-xpcs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/pcs/pcs-xpcs.c +1 -1
index 539cd43eae8d..f19d48c94fe0 100644
@@ -1203,7 +1203,7 @@ static const struct xpcs_compat synopsys_xpcs_compat[DW_XPCS_INTERFACE_MAX] = {
 	[DW_XPCS_2500BASEX] = {
 		.supported = xpcs_2500basex_features,
 		.interface = xpcs_2500basex_interfaces,
-		.num_interfaces = ARRAY_SIZE(xpcs_2500basex_features),
+		.num_interfaces = ARRAY_SIZE(xpcs_2500basex_interfaces),
 		.an_mode = DW_2500BASEX,
 	},
 };
Signature · 1 line
2.30.2
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Russell King (Oracle)

In synopsys_xpcs_compat[], the DW_XPCS_2500BASEX entry was setting the number of interfaces using the xpcs_2500basex_features array rather than xpcs_2500basex_interfaces. This causes us to overflow the array of interfaces. Fix this.

Fixes f27abde3042a ("net: pcs: add 2500BASEX support for Intel mGbE controller")

Andrew

Reviewed-by on v1 1/1
#2 lore raw
In reply to Russell King (Oracle)
Quoted 11 lines · Russell King (Oracle)

In synopsys_xpcs_compat[], the DW_XPCS_2500BASEX entry was setting the number of interfaces using the xpcs_2500basex_features array rather than xpcs_2500basex_interfaces. This causes us to overflow the array of interfaces. Fix this.

Fixes f27abde3042a ("net: pcs: add 2500BASEX support for Intel mGbE controller")
---
 drivers/net/pcs/pcs-xpcs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Thanks,

#3 lore raw
In reply to Russell King (Oracle)
This patch was applied to netdev/net.git (main) by David S. Miller <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by David S. Miller <[email protected]>:

Quoted 9 lines · On Tue, 09 May 2023 12:50:04 +0100 you wrote:

In synopsys_xpcs_compat[], the DW_XPCS_2500BASEX entry was setting the number of interfaces using the xpcs_2500basex_features array rather than xpcs_2500basex_interfaces. This causes us to overflow the array of interfaces. Fix this.

Fixes f27abde3042a ("net: pcs: add 2500BASEX support for Intel mGbE controller")

[...]

Here is the summary with links:
- [net] net: pcs: xpcs: fix incorrect number of interfaces

    https://git.kernel.org/netdev/net/c/43fb622d91a9

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html