Netdev List
 help / color / mirror / Atom feed
* [PATCH net] net: ps3: Unregister Ethernet when wireless probe fails
@ 2026-12-04 16:45 Wanhui Fu
  2026-12-05 17:20 ` netdev-bot+sashiko
  0 siblings, 1 reply; 2+ messages in thread
From: Wanhui Fu @ 2026-12-04 16:45 UTC (permalink / raw)
  To: geoff, andrew+netdev, davem, edumazet, kuba, pabeni, maddy, mpe,
	npiggin, chleroy, ritesh.list, sshegde, mokuno, dcbw, jeff,
	linville
  Cc: netdev, linuxppc-dev, Wanhui Fu

gelic_net_setup_netdev() registers the Ethernet netdev before wireless
initialization. When wireless initialization fails, the probe error
path calls free_netdev() while the Ethernet netdev is still registered,
triggering the registration-state BUG_ON().

Unregister the Ethernet netdev before entering the probe cleanup.

Found it by self-developed static analysis tool and compile-test
passed.

Fixes: 09dde54c6a69 ("PS3: gelic: Add wireless support for PS3")
Signed-off-by: Wanhui Fu <fuwh1120@163.com>
---
 drivers/net/ethernet/toshiba/ps3_gelic_net.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/toshiba/ps3_gelic_net.c b/drivers/net/ethernet/toshiba/ps3_gelic_net.c
index d35d1f3c10a1..dc660326bc12 100644
--- a/drivers/net/ethernet/toshiba/ps3_gelic_net.c
+++ b/drivers/net/ethernet/toshiba/ps3_gelic_net.c
@@ -1801,6 +1801,7 @@ static int ps3_gelic_driver_probe(struct ps3_system_bus_device *dev)
 	result = gelic_wl_driver_probe(card);
 	if (result) {
 		dev_dbg(&dev->core, "%s: WL init failed\n", __func__);
+		unregister_netdev(netdev);
 		goto fail_setup_netdev;
 	}
 #endif
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-12-05 17:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-04 16:45 [PATCH net] net: ps3: Unregister Ethernet when wireless probe fails Wanhui Fu
2026-12-05 17:20 ` netdev-bot+sashiko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox