aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/be2iscsi
diff options
context:
space:
mode:
authorJayamohan Kallickal <jayamohan.kallickal@emulex.com>2014-01-29 02:16:44 -0500
committerJames Bottomley <JBottomley@Parallels.com>2014-03-15 13:19:11 -0400
commitda3349771c7ca01415df49929b265c21bc4295c3 (patch)
tree9a65f9f0a59563faddfac3a6d78c6a7275c96bb3 /drivers/scsi/be2iscsi
parent9343be749085c2229622ef47058dca4937e30882 (diff)
[SCSI] be2iscsi: Fix scsi_cmnd leakage in driver.
scsi_cmnd n io_task was not NULL when - Link goes down while IO was happening and session is closed. - Task for which TMF was sent. Signed-off-by: John Soni Jose <sony.john-n@emulex.com> Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/be2iscsi')
-rw-r--r--drivers/scsi/be2iscsi/be_main.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index b1b6e74e0b7c..7b2bd16c8156 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -1366,8 +1366,10 @@ be_complete_io(struct beiscsi_conn *beiscsi_conn,
1366 resid = csol_cqe->res_cnt; 1366 resid = csol_cqe->res_cnt;
1367 1367
1368 if (!task->sc) { 1368 if (!task->sc) {
1369 if (io_task->scsi_cmnd) 1369 if (io_task->scsi_cmnd) {
1370 scsi_dma_unmap(io_task->scsi_cmnd); 1370 scsi_dma_unmap(io_task->scsi_cmnd);
1371 io_task->scsi_cmnd = NULL;
1372 }
1371 1373
1372 return; 1374 return;
1373 } 1375 }
@@ -1404,6 +1406,7 @@ be_complete_io(struct beiscsi_conn *beiscsi_conn,
1404 conn->rxdata_octets += resid; 1406 conn->rxdata_octets += resid;
1405unmap: 1407unmap:
1406 scsi_dma_unmap(io_task->scsi_cmnd); 1408 scsi_dma_unmap(io_task->scsi_cmnd);
1409 io_task->scsi_cmnd = NULL;
1407 iscsi_complete_scsi_task(task, exp_cmdsn, max_cmdsn); 1410 iscsi_complete_scsi_task(task, exp_cmdsn, max_cmdsn);
1408} 1411}
1409 1412
@@ -4653,6 +4656,11 @@ static void beiscsi_cleanup_task(struct iscsi_task *task)
4653 spin_unlock(&phba->io_sgl_lock); 4656 spin_unlock(&phba->io_sgl_lock);
4654 io_task->psgl_handle = NULL; 4657 io_task->psgl_handle = NULL;
4655 } 4658 }
4659
4660 if (io_task->scsi_cmnd) {
4661 scsi_dma_unmap(io_task->scsi_cmnd);
4662 io_task->scsi_cmnd = NULL;
4663 }
4656 } else { 4664 } else {
4657 if (!beiscsi_conn->login_in_progress) 4665 if (!beiscsi_conn->login_in_progress)
4658 beiscsi_free_mgmt_task_handles(beiscsi_conn, task); 4666 beiscsi_free_mgmt_task_handles(beiscsi_conn, task);