lan966x_probe_port() stores the newly allocated net_device in the
port before calling register_netdev(). If register_netdev() fails,
the probe error path calls lan966x_cleanup_ports(), which sees
port->dev and calls unregister_netdev() for a device that was never
registered.
Destroy the phylink instance created for this port and clear port->dev
before returning the registration error. The common cleanup path now skips
ports without port->dev before reaching the registered netdev cleanup, so
it only handles ports that reached the registered-netdev lifetime.
This also avoids treating an uninitialized FDMA netdev and the failed port
as a NULL == NULL match in the common cleanup path.
Fixes:
|
||
|---|---|---|
| .. | ||
| fdma | ||
| lan865x | ||
| lan966x | ||
| sparx5 | ||
| vcap | ||
| Kconfig | ||
| Makefile | ||
| enc28j60.c | ||
| enc28j60_hw.h | ||
| encx24j600-regmap.c | ||
| encx24j600.c | ||
| encx24j600_hw.h | ||
| lan743x_ethtool.c | ||
| lan743x_ethtool.h | ||
| lan743x_main.c | ||
| lan743x_main.h | ||
| lan743x_ptp.c | ||
| lan743x_ptp.h | ||