Message ID | 1438893498-17157-52-git-send-email-kamal@canonical.com |
---|---|
State | New |
Headers | show |
diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c index ba6e12a..19e7448 100644 --- a/net/dsa/dsa.c +++ b/net/dsa/dsa.c @@ -426,6 +426,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) @@ -448,8 +450,6 @@ static int dsa_of_probe(struct platform_device *pdev) goto out_free_chip; } - if (port_index == DSA_MAX_PORTS) - break; } }