summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJörn Engel <joern@logfs.org>2012-02-15 22:51:32 +0100
committerNicholas Bellinger <nab@linux-iscsi.org>2012-02-25 23:37:50 +0100
commit382436f8804fe1cb20b9a2a811a10eb2d8554721 (patch)
tree7eb91d8121092133c6b3a58928c54253b1d224b4
parenttcm_loop: Set residual field for SCSI commands (diff)
downloadlinux-382436f8804fe1cb20b9a2a811a10eb2d8554721.tar.xz
linux-382436f8804fe1cb20b9a2a811a10eb2d8554721.zip
target: fix use after free in target_report_luns
Fix possible NULL pointer dereference in target_report_luns failure path. Signed-off-by: Joern Engel <joern@logfs.org> Cc: stable@vger.kernel.org Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
-rw-r--r--drivers/target/target_core_device.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c
index 27da4e4e07c6..b0572f480c04 100644
--- a/drivers/target/target_core_device.c
+++ b/drivers/target/target_core_device.c
@@ -690,12 +690,12 @@ int target_report_luns(struct se_task *se_task)
* See SPC3 r07, page 159.
*/
done:
- transport_kunmap_data_sg(se_cmd);
lun_count *= 8;
buf[0] = ((lun_count >> 24) & 0xff);
buf[1] = ((lun_count >> 16) & 0xff);
buf[2] = ((lun_count >> 8) & 0xff);
buf[3] = (lun_count & 0xff);
+ transport_kunmap_data_sg(se_cmd);
se_task->task_scsi_status = GOOD;
transport_complete_task(se_task, 1);