The documentation for lan966x states that phy-mode is a required property but the code does not enforce this. Add an error check. Fixes: db8bcaad5393 ("net: lan966x: add the basic lan966x driver") Signed-off-by: Rosen Penev --- drivers/net/ethernet/microchip/lan966x/lan966x_main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_main.c b/drivers/net/ethernet/microchip/lan966x/lan966x_main.c index 7001584f1b7a..5d28710f4fd2 100644 --- a/drivers/net/ethernet/microchip/lan966x/lan966x_main.c +++ b/drivers/net/ethernet/microchip/lan966x/lan966x_main.c @@ -1199,6 +1199,9 @@ static int lan966x_probe(struct platform_device *pdev) continue; phy_mode = fwnode_get_phy_mode(portnp); + if (phy_mode) + goto cleanup_ports; + err = lan966x_probe_port(lan966x, p, phy_mode, portnp); if (err) goto cleanup_ports; -- 2.51.0