diff options
Diffstat (limited to 'drivers/scsi/fcoe/fcoe.c')
-rw-r--r-- | drivers/scsi/fcoe/fcoe.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c index 719a99d4a438..ebf2e20370d7 100644 --- a/drivers/scsi/fcoe/fcoe.c +++ b/drivers/scsi/fcoe/fcoe.c | |||
@@ -423,11 +423,8 @@ static int fcoe_shost_config(struct fc_lport *lp, struct Scsi_Host *shost, | |||
423 | */ | 423 | */ |
424 | static inline int fcoe_em_config(struct fc_lport *lp) | 424 | static inline int fcoe_em_config(struct fc_lport *lp) |
425 | { | 425 | { |
426 | BUG_ON(lp->emp); | 426 | if (!fc_exch_mgr_alloc(lp, FC_CLASS_3, FCOE_MIN_XID, |
427 | 427 | FCOE_MAX_XID, NULL)) | |
428 | lp->emp = fc_exch_mgr_alloc(lp, FC_CLASS_3, | ||
429 | FCOE_MIN_XID, FCOE_MAX_XID); | ||
430 | if (!lp->emp) | ||
431 | return -ENOMEM; | 428 | return -ENOMEM; |
432 | 429 | ||
433 | return 0; | 430 | return 0; |
@@ -478,8 +475,7 @@ static int fcoe_if_destroy(struct net_device *netdev) | |||
478 | scsi_remove_host(lp->host); | 475 | scsi_remove_host(lp->host); |
479 | 476 | ||
480 | /* There are no more rports or I/O, free the EM */ | 477 | /* There are no more rports or I/O, free the EM */ |
481 | if (lp->emp) | 478 | fc_exch_mgr_free(lp); |
482 | fc_exch_mgr_free(lp->emp); | ||
483 | 479 | ||
484 | /* Free existing skbs */ | 480 | /* Free existing skbs */ |
485 | fcoe_clean_pending_queue(lp); | 481 | fcoe_clean_pending_queue(lp); |
@@ -634,7 +630,7 @@ static int fcoe_if_create(struct net_device *netdev) | |||
634 | return rc; | 630 | return rc; |
635 | 631 | ||
636 | out_lp_destroy: | 632 | out_lp_destroy: |
637 | fc_exch_mgr_free(lp->emp); /* Free the EM */ | 633 | fc_exch_mgr_free(lp); |
638 | out_netdev_cleanup: | 634 | out_netdev_cleanup: |
639 | fcoe_netdev_cleanup(fc); | 635 | fcoe_netdev_cleanup(fc); |
640 | out_host_put: | 636 | out_host_put: |
@@ -1277,7 +1273,7 @@ int fcoe_percpu_receive_thread(void *arg) | |||
1277 | fh = fc_frame_header_get(fp); | 1273 | fh = fc_frame_header_get(fp); |
1278 | if (fh->fh_r_ctl == FC_RCTL_DD_SOL_DATA && | 1274 | if (fh->fh_r_ctl == FC_RCTL_DD_SOL_DATA && |
1279 | fh->fh_type == FC_TYPE_FCP) { | 1275 | fh->fh_type == FC_TYPE_FCP) { |
1280 | fc_exch_recv(lp, lp->emp, fp); | 1276 | fc_exch_recv(lp, fp); |
1281 | continue; | 1277 | continue; |
1282 | } | 1278 | } |
1283 | if (fr_flags(fp) & FCPHF_CRC_UNCHECKED) { | 1279 | if (fr_flags(fp) & FCPHF_CRC_UNCHECKED) { |
@@ -1298,7 +1294,7 @@ int fcoe_percpu_receive_thread(void *arg) | |||
1298 | fc_frame_free(fp); | 1294 | fc_frame_free(fp); |
1299 | continue; | 1295 | continue; |
1300 | } | 1296 | } |
1301 | fc_exch_recv(lp, lp->emp, fp); | 1297 | fc_exch_recv(lp, fp); |
1302 | } | 1298 | } |
1303 | return 0; | 1299 | return 0; |
1304 | } | 1300 | } |