Message ID | 1438811293-32561-1-git-send-email-kamal@canonical.com |
---|---|
State | New |
Headers | show |
diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c index ed1bcee..43bc5c7 100644 --- a/net/dsa/dsa.c +++ b/net/dsa/dsa.c @@ -639,6 +639,8 @@ static int dsa_of_probe(struct platform_device *pdev) continue; port_index = be32_to_cpup(port_reg); + if (port_index >= DSA_MAX_PORTS) + break; port_name = of_get_property(port, "label", NULL); if (!port_name) @@ -663,8 +665,6 @@ static int dsa_of_probe(struct platform_device *pdev) goto out_free_chip; } - if (port_index == DSA_MAX_PORTS) - break; } }