mirror-linux/drivers/net/ethernet/microchip
Myeonghun Pak c4f3d6eb1f net: lan966x: avoid unregistering netdev on register failure
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: d28d6d2e37 ("net: lan966x: add port module support")
Co-developed-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
Link: https://patch.msgid.link/20260506124331.31945-1-mhun512@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-05-08 16:30:45 -07:00
..
fdma net: microchip: dead code cleanup in kconfig for FDMA 2026-04-01 19:50:12 -07:00
lan865x microchip: lan865x: Enable MAC address validation 2025-09-15 18:34:08 -07:00
lan966x net: lan966x: avoid unregistering netdev on register failure 2026-05-08 16:30:45 -07:00
sparx5 net: sparx5: configure serdes for 1000BASE-X in sparx5_port_init() 2026-05-07 09:08:47 -07:00
vcap Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
Kconfig net: lan969x: fix cyclic dependency reported by depmod 2024-12-09 13:30:16 +00:00
Makefile net: lan969x: fix cyclic dependency reported by depmod 2024-12-09 13:30:16 +00:00
enc28j60.c
enc28j60_hw.h
encx24j600-regmap.c net: encx24j600: constify struct regmap_bus/regmap_config 2024-07-05 17:02:20 -07:00
encx24j600.c
encx24j600_hw.h
lan743x_ethtool.c net: microchip: lan743x: add ethtool nway_reset support 2026-02-24 15:10:56 +01:00
lan743x_ethtool.h
lan743x_main.c net: lan743x: rename chip_rev to fpga_rev 2026-04-12 09:41:56 -07:00
lan743x_main.h net: lan743x: fix SGMII detection on PCI1xxxx B0+ during warm reset 2026-03-20 18:50:23 -07:00
lan743x_ptp.c net: lan743x: implement ndo_hwtstamp_get() 2025-05-15 17:56:38 -07:00
lan743x_ptp.h net: lan743x: fix potential out-of-bounds write in lan743x_ptp_io_event_clock_get() 2025-06-19 15:32:14 +02:00