diff options
Diffstat (limited to 'net/dsa')
-rw-r--r-- | net/dsa/dsa.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c index 5db37cef50a9..d3ca32dc167f 100644 --- a/net/dsa/dsa.c +++ b/net/dsa/dsa.c @@ -427,6 +427,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) @@ -449,8 +451,6 @@ static int dsa_of_probe(struct platform_device *pdev) goto out_free_chip; } - if (port_index == DSA_MAX_PORTS) - break; } } |