return NULL;
}
+static void bnx2fc_net_cleanup(struct bnx2fc_interface *interface)
+{
+ /* Dont listen for Ethernet packets anymore */
+ __dev_remove_pack(&interface->fcoe_packet_type);
+ __dev_remove_pack(&interface->fip_packet_type);
+ synchronize_net();
+}
+
static void bnx2fc_interface_cleanup(struct bnx2fc_interface *interface)
{
struct fc_lport *lport = interface->ctlr.lp;
/* Free existing transmit skbs */
fcoe_clean_pending_queue(lport);
- /* Dont listen for Ethernet packets anymore */
- __dev_remove_pack(&interface->fcoe_packet_type);
- __dev_remove_pack(&interface->fip_packet_type);
- synchronize_net();
+ bnx2fc_net_cleanup(interface);
bnx2fc_free_vport(hba, lport);
}
if (!lport) {
printk(KERN_ERR PFX "Failed to create interface (%s)\n",
netdev->name);
- bnx2fc_interface_cleanup(interface);
rc = -EINVAL;
goto if_create_err;
}
if_create_err:
destroy_workqueue(interface->timer_work_queue);
ifput_err:
+ bnx2fc_net_cleanup(interface);
bnx2fc_interface_put(interface);
netdev_err:
module_put(THIS_MODULE);