diff options
Diffstat (limited to 'drivers/scsi/fcoe/fcoe.c')
-rw-r--r-- | drivers/scsi/fcoe/fcoe.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c index b5d92fc93c70..9bfdc9a3f897 100644 --- a/drivers/scsi/fcoe/fcoe.c +++ b/drivers/scsi/fcoe/fcoe.c | |||
@@ -490,7 +490,6 @@ static void fcoe_interface_cleanup(struct fcoe_interface *fcoe) | |||
490 | { | 490 | { |
491 | struct net_device *netdev = fcoe->netdev; | 491 | struct net_device *netdev = fcoe->netdev; |
492 | struct fcoe_ctlr *fip = fcoe_to_ctlr(fcoe); | 492 | struct fcoe_ctlr *fip = fcoe_to_ctlr(fcoe); |
493 | struct fcoe_ctlr_device *ctlr_dev = fcoe_ctlr_to_ctlr_dev(fip); | ||
494 | 493 | ||
495 | rtnl_lock(); | 494 | rtnl_lock(); |
496 | if (!fcoe->removed) | 495 | if (!fcoe->removed) |
@@ -501,7 +500,6 @@ static void fcoe_interface_cleanup(struct fcoe_interface *fcoe) | |||
501 | /* tear-down the FCoE controller */ | 500 | /* tear-down the FCoE controller */ |
502 | fcoe_ctlr_destroy(fip); | 501 | fcoe_ctlr_destroy(fip); |
503 | scsi_host_put(fip->lp->host); | 502 | scsi_host_put(fip->lp->host); |
504 | fcoe_ctlr_device_delete(ctlr_dev); | ||
505 | dev_put(netdev); | 503 | dev_put(netdev); |
506 | module_put(THIS_MODULE); | 504 | module_put(THIS_MODULE); |
507 | } | 505 | } |
@@ -2194,6 +2192,8 @@ out_nodev: | |||
2194 | */ | 2192 | */ |
2195 | static void fcoe_destroy_work(struct work_struct *work) | 2193 | static void fcoe_destroy_work(struct work_struct *work) |
2196 | { | 2194 | { |
2195 | struct fcoe_ctlr_device *cdev; | ||
2196 | struct fcoe_ctlr *ctlr; | ||
2197 | struct fcoe_port *port; | 2197 | struct fcoe_port *port; |
2198 | struct fcoe_interface *fcoe; | 2198 | struct fcoe_interface *fcoe; |
2199 | struct Scsi_Host *shost; | 2199 | struct Scsi_Host *shost; |
@@ -2224,10 +2224,15 @@ static void fcoe_destroy_work(struct work_struct *work) | |||
2224 | mutex_lock(&fcoe_config_mutex); | 2224 | mutex_lock(&fcoe_config_mutex); |
2225 | 2225 | ||
2226 | fcoe = port->priv; | 2226 | fcoe = port->priv; |
2227 | ctlr = fcoe_to_ctlr(fcoe); | ||
2228 | cdev = fcoe_ctlr_to_ctlr_dev(ctlr); | ||
2229 | |||
2227 | fcoe_if_destroy(port->lport); | 2230 | fcoe_if_destroy(port->lport); |
2228 | fcoe_interface_cleanup(fcoe); | 2231 | fcoe_interface_cleanup(fcoe); |
2229 | 2232 | ||
2230 | mutex_unlock(&fcoe_config_mutex); | 2233 | mutex_unlock(&fcoe_config_mutex); |
2234 | |||
2235 | fcoe_ctlr_device_delete(cdev); | ||
2231 | } | 2236 | } |
2232 | 2237 | ||
2233 | /** | 2238 | /** |
@@ -2335,7 +2340,9 @@ static int _fcoe_create(struct net_device *netdev, enum fip_state fip_mode, | |||
2335 | rc = -EIO; | 2340 | rc = -EIO; |
2336 | rtnl_unlock(); | 2341 | rtnl_unlock(); |
2337 | fcoe_interface_cleanup(fcoe); | 2342 | fcoe_interface_cleanup(fcoe); |
2338 | goto out_nortnl; | 2343 | mutex_unlock(&fcoe_config_mutex); |
2344 | fcoe_ctlr_device_delete(ctlr_dev); | ||
2345 | goto out; | ||
2339 | } | 2346 | } |
2340 | 2347 | ||
2341 | /* Make this the "master" N_Port */ | 2348 | /* Make this the "master" N_Port */ |
@@ -2375,8 +2382,8 @@ static int _fcoe_create(struct net_device *netdev, enum fip_state fip_mode, | |||
2375 | 2382 | ||
2376 | out_nodev: | 2383 | out_nodev: |
2377 | rtnl_unlock(); | 2384 | rtnl_unlock(); |
2378 | out_nortnl: | ||
2379 | mutex_unlock(&fcoe_config_mutex); | 2385 | mutex_unlock(&fcoe_config_mutex); |
2386 | out: | ||
2380 | return rc; | 2387 | return rc; |
2381 | } | 2388 | } |
2382 | 2389 | ||