|
@@ -642,6 +642,8 @@ static int dsa_of_probe(struct device *dev)
|
|
continue;
|
|
continue;
|
|
|
|
|
|
port_index = be32_to_cpup(port_reg);
|
|
port_index = be32_to_cpup(port_reg);
|
|
|
|
+ if (port_index >= DSA_MAX_PORTS)
|
|
|
|
+ break;
|
|
|
|
|
|
port_name = of_get_property(port, "label", NULL);
|
|
port_name = of_get_property(port, "label", NULL);
|
|
if (!port_name)
|
|
if (!port_name)
|
|
@@ -666,8 +668,6 @@ static int dsa_of_probe(struct device *dev)
|
|
goto out_free_chip;
|
|
goto out_free_chip;
|
|
}
|
|
}
|
|
|
|
|
|
- if (port_index == DSA_MAX_PORTS)
|
|
|
|
- break;
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|