Skip to content

Commit

Permalink
target: fix use after free in target_report_luns
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jörn Engel authored and Nicholas Bellinger committed Feb 25, 2012
1 parent 6cf3fa6 commit 382436f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/target/target_core_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 382436f

Please sign in to comment.