author: Florian Fainelli <f.fainelli@gmail.com> 2021-09-16 14:33:35 -0700
committer: Greg Kroah-Hartman <gregkh@linuxfoundation.org> 2021-09-22 12:39:33 +0200
commit: 10203c14d608d8ca3ebdc04f52bf3e90efcb72a6
parent: 45c0e1ee3e9f442d9a4ee72b10ef926c6b32a8f5
Commit Summary:
Diffstat:
1 file changed, 1 insertion, 1 deletion
diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c
index 6ce9ec1283e0..b6c4b3adb171 100644
--- a/drivers/net/dsa/bcm_sf2.c
+++ b/drivers/net/dsa/bcm_sf2.c
@@ -68,7 +68,7 @@ static unsigned int bcm_sf2_num_active_ports(struct dsa_switch *ds)
struct bcm_sf2_priv *priv = bcm_sf2_to_priv(ds);
unsigned int port, count = 0;
- for (port = 0; port < ARRAY_SIZE(priv->port_sts); port++) {
+ for (port = 0; port < ds->num_ports; port++) {
if (dsa_is_cpu_port(ds, port))
continue;
if (priv->port_sts[port].enabled)