Commit 8209f5bc authored by Rafał Miłecki's avatar Rafał Miłecki Committed by Jakub Kicinski

net: dsa: print error on invalid port index

Looking for an -EINVAL all over the dsa code could take hours for
inexperienced DSA users.
Signed-off-by: default avatarRafał Miłecki <rafal@milecki.pl>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/20210106090915.21439-1-zajec5@gmail.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent ede71cae
...@@ -783,6 +783,8 @@ static int dsa_switch_parse_ports_of(struct dsa_switch *ds, ...@@ -783,6 +783,8 @@ static int dsa_switch_parse_ports_of(struct dsa_switch *ds,
goto out_put_node; goto out_put_node;
if (reg >= ds->num_ports) { if (reg >= ds->num_ports) {
dev_err(ds->dev, "port %pOF index %u exceeds num_ports (%zu)\n",
port, reg, ds->num_ports);
err = -EINVAL; err = -EINVAL;
goto out_put_node; goto out_put_node;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment