aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/target
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/target')
-rw-r--r--drivers/target/target_core_device.c3
-rw-r--r--drivers/target/target_core_tmr.c8
2 files changed, 9 insertions, 2 deletions
diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c
index 8407f9ca2b31..f8d8af7a0d41 100644
--- a/drivers/target/target_core_device.c
+++ b/drivers/target/target_core_device.c
@@ -192,7 +192,7 @@ int transport_get_lun_for_tmr(
192 &SE_NODE_ACL(se_sess)->device_list[unpacked_lun]; 192 &SE_NODE_ACL(se_sess)->device_list[unpacked_lun];
193 if (deve->lun_flags & TRANSPORT_LUNFLAGS_INITIATOR_ACCESS) { 193 if (deve->lun_flags & TRANSPORT_LUNFLAGS_INITIATOR_ACCESS) {
194 se_lun = se_cmd->se_lun = se_tmr->tmr_lun = deve->se_lun; 194 se_lun = se_cmd->se_lun = se_tmr->tmr_lun = deve->se_lun;
195 dev = se_tmr->tmr_dev = se_lun->lun_se_dev; 195 dev = se_lun->lun_se_dev;
196 se_cmd->pr_res_key = deve->pr_res_key; 196 se_cmd->pr_res_key = deve->pr_res_key;
197 se_cmd->orig_fe_lun = unpacked_lun; 197 se_cmd->orig_fe_lun = unpacked_lun;
198 se_cmd->se_orig_obj_ptr = SE_LUN(se_cmd)->lun_se_dev; 198 se_cmd->se_orig_obj_ptr = SE_LUN(se_cmd)->lun_se_dev;
@@ -216,6 +216,7 @@ int transport_get_lun_for_tmr(
216 se_cmd->se_cmd_flags |= SCF_SCSI_CDB_EXCEPTION; 216 se_cmd->se_cmd_flags |= SCF_SCSI_CDB_EXCEPTION;
217 return -1; 217 return -1;
218 } 218 }
219 se_tmr->tmr_dev = dev;
219 220
220 spin_lock(&dev->se_tmr_lock); 221 spin_lock(&dev->se_tmr_lock);
221 list_add_tail(&se_tmr->tmr_list, &dev->dev_tmr_list); 222 list_add_tail(&se_tmr->tmr_list, &dev->dev_tmr_list);
diff --git a/drivers/target/target_core_tmr.c b/drivers/target/target_core_tmr.c
index 59b8b9c5ad72..179063d81cdd 100644
--- a/drivers/target/target_core_tmr.c
+++ b/drivers/target/target_core_tmr.c
@@ -75,10 +75,16 @@ void core_tmr_release_req(
75{ 75{
76 struct se_device *dev = tmr->tmr_dev; 76 struct se_device *dev = tmr->tmr_dev;
77 77
78 if (!dev) {
79 kmem_cache_free(se_tmr_req_cache, tmr);
80 return;
81 }
82
78 spin_lock(&dev->se_tmr_lock); 83 spin_lock(&dev->se_tmr_lock);
79 list_del(&tmr->tmr_list); 84 list_del(&tmr->tmr_list);
80 kmem_cache_free(se_tmr_req_cache, tmr);
81 spin_unlock(&dev->se_tmr_lock); 85 spin_unlock(&dev->se_tmr_lock);
86
87 kmem_cache_free(se_tmr_req_cache, tmr);
82} 88}
83 89
84static void core_tmr_handle_tas_abort( 90static void core_tmr_handle_tas_abort(