Skip to content

Commit 88fb2fa

Browse files
tangwenjiNicholas Bellinger
authored andcommitted
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 51ec502 Author: Bart Van Assche <[email protected]> Date: Tue Feb 14 16:25:54 2017 -0800 target: Delete tmr from list before processing Signed-off-by: tangwenji <[email protected]> Cc: [email protected] # 4.11+ Signed-off-by: Nicholas Bellinger <[email protected]>
1 parent 594e25e commit 88fb2fa

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/target/target_core_tmr.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,8 @@ static void core_tmr_drain_tmr_list(
217217
* LUN_RESET tmr..
218218
*/
219219
spin_lock_irqsave(&dev->se_tmr_lock, flags);
220-
list_del_init(&tmr->tmr_list);
220+
if (tmr)
221+
list_del_init(&tmr->tmr_list);
221222
list_for_each_entry_safe(tmr_p, tmr_pp, &dev->dev_tmr_list, tmr_list) {
222223
cmd = tmr_p->task_cmd;
223224
if (!cmd) {

0 commit comments

Comments
 (0)