rtmdio_probe_one() should be only called by rtmdio_probe() after it
has validated the dts input. Nevertheless be defensive and add
another consistency check.
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/23204
Signed-off-by: Robert Marko <robimarko@gmail.com>
ret = fwnode_property_read_u32(node, "reg", &smi_bus);
if (ret)
- return ret;
+ return dev_err_probe(dev, ret, "%pfwP missing reg property for MDIO bus\n", node);
+ if (smi_bus >= ctrl->cfg->num_busses)
+ return dev_err_probe(dev, -EINVAL, "%pfwP wrong bus index %d\n", node, smi_bus);
bus = devm_mdiobus_alloc_size(dev, sizeof(*chan));
if (!bus)