aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libfc/fc_exch.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/libfc/fc_exch.c')
-rw-r--r--drivers/scsi/libfc/fc_exch.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c
index f5a0665b6773..01ff082dc34c 100644
--- a/drivers/scsi/libfc/fc_exch.c
+++ b/drivers/scsi/libfc/fc_exch.c
@@ -802,10 +802,8 @@ static struct fc_exch *fc_exch_find(struct fc_exch_mgr *mp, u16 xid)
802 pool = per_cpu_ptr(mp->pool, xid & fc_cpu_mask); 802 pool = per_cpu_ptr(mp->pool, xid & fc_cpu_mask);
803 spin_lock_bh(&pool->lock); 803 spin_lock_bh(&pool->lock);
804 ep = fc_exch_ptr_get(pool, (xid - mp->min_xid) >> fc_cpu_order); 804 ep = fc_exch_ptr_get(pool, (xid - mp->min_xid) >> fc_cpu_order);
805 if (ep) { 805 if (ep && ep->xid == xid)
806 fc_exch_hold(ep); 806 fc_exch_hold(ep);
807 WARN_ON(ep->xid != xid);
808 }
809 spin_unlock_bh(&pool->lock); 807 spin_unlock_bh(&pool->lock);
810 } 808 }
811 return ep; 809 return ep;
@@ -2465,8 +2463,11 @@ int fc_setup_exch_mgr(void)
2465 2463
2466 fc_exch_workqueue = create_singlethread_workqueue("fc_exch_workqueue"); 2464 fc_exch_workqueue = create_singlethread_workqueue("fc_exch_workqueue");
2467 if (!fc_exch_workqueue) 2465 if (!fc_exch_workqueue)
2468 return -ENOMEM; 2466 goto err;
2469 return 0; 2467 return 0;
2468err:
2469 kmem_cache_destroy(fc_em_cachep);
2470 return -ENOMEM;
2470} 2471}
2471 2472
2472/** 2473/**