diff --git a/iscsi-scst/kernel/isert-scst/iser_rdma.c b/iscsi-scst/kernel/isert-scst/iser_rdma.c index 4f896c0eb..c6b724dea 100644 --- a/iscsi-scst/kernel/isert-scst/iser_rdma.c +++ b/iscsi-scst/kernel/isert-scst/iser_rdma.c @@ -1144,7 +1144,7 @@ out: static void isert_device_release(struct isert_device *isert_dev) { - int err, i; + int i; TRACE_ENTRY(); @@ -1165,10 +1165,7 @@ static void isert_device_release(struct isert_device *isert_dev) cancel_work_sync(&cq_desc->cq_comp_work); #endif - err = ib_destroy_cq(cq_desc->cq); - if (unlikely(err)) - PRINT_ERROR("Failed to destroy cq, err:%d", err); - + ib_destroy_cq(cq_desc->cq); destroy_workqueue(cq_desc->cq_workqueue); } diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 2dff03838..2f6704934 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -5539,6 +5539,7 @@ void scst_nexus_loss(struct scst_tgt_dev *tgt_dev, bool queue_UA) static void scst_del_tgt_dev(struct scst_tgt_dev *tgt_dev) { + struct scst_tgt_template *tgtt = tgt_dev->tgtt; struct scst_device *dev = tgt_dev->dev; lockdep_assert_held(&scst_mutex); @@ -5555,6 +5556,9 @@ static void scst_del_tgt_dev(struct scst_tgt_dev *tgt_dev) scst_tgt_dev_sysfs_del(tgt_dev); + if (tgtt->get_initiator_port_transport_id == NULL) + dev->not_pr_supporting_tgt_devs_num--; + atomic_dec(&tgt_dev->tgt_dev_cmd_count); } @@ -5566,7 +5570,6 @@ static void scst_del_tgt_dev(struct scst_tgt_dev *tgt_dev) */ static void scst_free_tgt_dev(struct scst_tgt_dev *tgt_dev) { - struct scst_tgt_template *tgtt = tgt_dev->tgtt; struct scst_device *dev = tgt_dev->dev; TRACE_ENTRY(); @@ -5576,9 +5579,6 @@ static void scst_free_tgt_dev(struct scst_tgt_dev *tgt_dev) #endif WARN_ON_ONCE(atomic_read(&tgt_dev->tgt_dev_cmd_count) != 0); - if (tgtt->get_initiator_port_transport_id == NULL) - dev->not_pr_supporting_tgt_devs_num--; - scst_clear_reservation(tgt_dev); scst_pr_clear_tgt_dev(tgt_dev); scst_free_all_UA(tgt_dev);