Skip to content

Commit 43fb622

Browse files
Russell King (Oracle)davem330
authored andcommitted
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: f27abde ("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>
1 parent d0ac89f commit 43fb622

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/net/pcs/pcs-xpcs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1203,7 +1203,7 @@ static const struct xpcs_compat synopsys_xpcs_compat[DW_XPCS_INTERFACE_MAX] = {
12031203
[DW_XPCS_2500BASEX] = {
12041204
.supported = xpcs_2500basex_features,
12051205
.interface = xpcs_2500basex_interfaces,
1206-
.num_interfaces = ARRAY_SIZE(xpcs_2500basex_features),
1206+
.num_interfaces = ARRAY_SIZE(xpcs_2500basex_interfaces),
12071207
.an_mode = DW_2500BASEX,
12081208
},
12091209
};

0 commit comments

Comments
 (0)