Commit 88fb2fa7 authored by tangwenji's avatar tangwenji Committed by Nicholas Bellinger

target: fix null pointer regression in core_tmr_drain_tmr_list

The target system kernel crash when the initiator executes
the sg_persist -A command,because of the second argument to
be set to NULL when core_tmr_lun_reset is called in
core_scsi3_pro_preempt function.

This fixes a regression originally introduced by:

  commit 51ec502a
  Author: Bart Van Assche <bart.vanassche@sandisk.com>
  Date:   Tue Feb 14 16:25:54 2017 -0800

      target: Delete tmr from list before processing
Signed-off-by: default avatartangwenji <tang.wenji@zte.com.cn>
Cc: stable@vger.kernel.org # 4.11+
Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
parent 594e25e7
...@@ -217,6 +217,7 @@ static void core_tmr_drain_tmr_list( ...@@ -217,6 +217,7 @@ static void core_tmr_drain_tmr_list(
* LUN_RESET tmr.. * LUN_RESET tmr..
*/ */
spin_lock_irqsave(&dev->se_tmr_lock, flags); spin_lock_irqsave(&dev->se_tmr_lock, flags);
if (tmr)
list_del_init(&tmr->tmr_list); list_del_init(&tmr->tmr_list);
list_for_each_entry_safe(tmr_p, tmr_pp, &dev->dev_tmr_list, tmr_list) { list_for_each_entry_safe(tmr_p, tmr_pp, &dev->dev_tmr_list, tmr_list) {
cmd = tmr_p->task_cmd; cmd = tmr_p->task_cmd;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment