Skip to content

Commit

Permalink
Merge branch 'dsa-of-parsing-fixes'
Browse files Browse the repository at this point in the history
Florian Fainelli says:

====================
net: dsa: OF parsing fixes

This patch series fixes two small parsing issues, the first one was
reported by Dan, the second came after looking more closely at the
code.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Jul 12, 2015
2 parents 2ee9401 + c8cf89f commit 76b63da
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions net/dsa/dsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ static int dsa_of_probe(struct device *dev)
continue;

cd->sw_addr = be32_to_cpup(sw_addr);
if (cd->sw_addr > PHY_MAX_ADDR)
if (cd->sw_addr >= PHY_MAX_ADDR)
continue;

if (!of_property_read_u32(child, "eeprom-length", &eeprom_len))
Expand All @@ -642,6 +642,8 @@ static int dsa_of_probe(struct device *dev)
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)
Expand All @@ -666,8 +668,6 @@ static int dsa_of_probe(struct device *dev)
goto out_free_chip;
}

if (port_index == DSA_MAX_PORTS)
break;
}
}

Expand Down

0 comments on commit 76b63da

Please sign in to comment.