aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/fcoe/fcoe.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/fcoe/fcoe.c')
-rw-r--r--drivers/scsi/fcoe/fcoe.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c
index ba710e350ac5..5d0e9a24ae94 100644
--- a/drivers/scsi/fcoe/fcoe.c
+++ b/drivers/scsi/fcoe/fcoe.c
@@ -432,6 +432,8 @@ void fcoe_interface_cleanup(struct fcoe_interface *fcoe)
432 u8 flogi_maddr[ETH_ALEN]; 432 u8 flogi_maddr[ETH_ALEN];
433 const struct net_device_ops *ops; 433 const struct net_device_ops *ops;
434 434
435 rtnl_lock();
436
435 /* 437 /*
436 * Don't listen for Ethernet packets anymore. 438 * Don't listen for Ethernet packets anymore.
437 * synchronize_net() ensures that the packet handlers are not running 439 * synchronize_net() ensures that the packet handlers are not running
@@ -461,6 +463,8 @@ void fcoe_interface_cleanup(struct fcoe_interface *fcoe)
461 " specific feature for LLD.\n"); 463 " specific feature for LLD.\n");
462 } 464 }
463 465
466 rtnl_unlock();
467
464 /* Release the self-reference taken during fcoe_interface_create() */ 468 /* Release the self-reference taken during fcoe_interface_create() */
465 fcoe_interface_put(fcoe); 469 fcoe_interface_put(fcoe);
466} 470}
@@ -1951,11 +1955,8 @@ static void fcoe_destroy_work(struct work_struct *work)
1951 fcoe_if_destroy(port->lport); 1955 fcoe_if_destroy(port->lport);
1952 1956
1953 /* Do not tear down the fcoe interface for NPIV port */ 1957 /* Do not tear down the fcoe interface for NPIV port */
1954 if (!npiv) { 1958 if (!npiv)
1955 rtnl_lock();
1956 fcoe_interface_cleanup(fcoe); 1959 fcoe_interface_cleanup(fcoe);
1957 rtnl_unlock();
1958 }
1959 1960
1960 mutex_unlock(&fcoe_config_mutex); 1961 mutex_unlock(&fcoe_config_mutex);
1961} 1962}
@@ -2009,8 +2010,9 @@ static int fcoe_create(struct net_device *netdev, enum fip_state fip_mode)
2009 printk(KERN_ERR "fcoe: Failed to create interface (%s)\n", 2010 printk(KERN_ERR "fcoe: Failed to create interface (%s)\n",
2010 netdev->name); 2011 netdev->name);
2011 rc = -EIO; 2012 rc = -EIO;
2013 rtnl_unlock();
2012 fcoe_interface_cleanup(fcoe); 2014 fcoe_interface_cleanup(fcoe);
2013 goto out_nodev; 2015 goto out_nortnl;
2014 } 2016 }
2015 2017
2016 /* Make this the "master" N_Port */ 2018 /* Make this the "master" N_Port */
@@ -2027,6 +2029,7 @@ static int fcoe_create(struct net_device *netdev, enum fip_state fip_mode)
2027 2029
2028out_nodev: 2030out_nodev:
2029 rtnl_unlock(); 2031 rtnl_unlock();
2032out_nortnl:
2030 mutex_unlock(&fcoe_config_mutex); 2033 mutex_unlock(&fcoe_config_mutex);
2031 return rc; 2034 return rc;
2032} 2035}