diff mbox series

[net] net: pcs: xpcs: fix incorrect number of interfaces

Message ID E1pwLr2-001Ms2-3d@rmk-PC.armlinux.org.uk (mailing list archive)
State Accepted
Commit 43fb622d91a9f408322735d2f736495c1009f575
Delegated to: Netdev Maintainers
Headers show
Series [net] net: pcs: xpcs: fix incorrect number of interfaces | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 8 this patch: 8
netdev/cc_maintainers success CCed 11 of 11 maintainers
netdev/build_clang success Errors and warnings before: 8 this patch: 8
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 8 this patch: 8
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Russell King (Oracle) May 9, 2023, 11:50 a.m. UTC
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")
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
 drivers/net/pcs/pcs-xpcs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andrew Lunn May 9, 2023, 12:24 p.m. UTC | #1
On Tue, May 09, 2023 at 12:50:04PM +0100, Russell King (Oracle) 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")
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew
Leon Romanovsky May 9, 2023, 1:45 p.m. UTC | #2
On Tue, May 09, 2023 at 12:50:04PM +0100, Russell King (Oracle) 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")
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
> ---
>  drivers/net/pcs/pcs-xpcs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Thanks,
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
patchwork-bot+netdevbpf@kernel.org May 10, 2023, 9:30 a.m. UTC | #3
Hello:

This patch was applied to netdev/net.git (main)
by David S. Miller <davem@davemloft.net>:

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")
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
> 
> [...]

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!
diff mbox series

Patch

diff --git a/drivers/net/pcs/pcs-xpcs.c b/drivers/net/pcs/pcs-xpcs.c
index 539cd43eae8d..f19d48c94fe0 100644
--- a/drivers/net/pcs/pcs-xpcs.c
+++ b/drivers/net/pcs/pcs-xpcs.c
@@ -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,
 	},
 };