netfront: unregister net device at backend_changed() if network_connect() failed
Quoted 3 lines
My point is, if you
unregister_netdev()on failednetwork_connect(), and then do it unconditionally again innetfront_remove(), you willBUG_ON()inunregister_netdevice().
Sorry I dont notice that
Could we add a test in netfront_remove like below? static int __devexit netfront_remove(struct xenbus_device *dev) {
<--snip-->
if (info->netdev->reg_state == NETREG_REGISTERED)
unregister_netdev(info->netdev);<--snip-->
}
This will avoid the crash when call netfront_remove.
Thanks,
Joe