diff options
author | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2023-05-09 13:50:04 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-05-10 11:25:02 +0200 |
commit | 43fb622d91a9f408322735d2f736495c1009f575 (patch) | |
tree | 129618de2e41edcc59ea06043ca67bc720db1fe1 /drivers/net/pcs/pcs-xpcs.c | |
parent | net: deal with most data-races in sk_wait_event() (diff) | |
download | linux-43fb622d91a9f408322735d2f736495c1009f575.tar.xz linux-43fb622d91a9f408322735d2f736495c1009f575.zip |
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")
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/pcs/pcs-xpcs.c')
-rw-r--r-- | drivers/net/pcs/pcs-xpcs.c | 2 |
1 files changed, 1 insertions, 1 deletions
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, }, }; |