VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   32 Branches   54 Tags
author: David Disseldorp <ddiss@suse.de> 2021-07-21 00:55:22 +0200 committer: Greg Kroah-Hartman <gregkh@linuxfoundation.org> 2021-07-28 14:37:32 +0200 commit: e7732c5a19a15a62b0b23fd683a639b0483e1f40 parent: 2ed13e8f7829dc9011a3d02f25c63b9ce14e9c94
Commit Summary:
scsi: target: Fix NULL dereference on XCOPY completion
Diffstat:
1 file changed, 1 insertion, 1 deletion
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
index 7e35eddd9eb7..26ceabe34de5 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -886,7 +886,7 @@ void target_complete_cmd(struct se_cmd *cmd, u8 scsi_status)
 	INIT_WORK(&cmd->work, success ? target_complete_ok_work :
 		  target_complete_failure_work);
 
-	if (wwn->cmd_compl_affinity == SE_COMPL_AFFINITY_CPUID)
+	if (!wwn || wwn->cmd_compl_affinity == SE_COMPL_AFFINITY_CPUID)
 		cpu = cmd->cpuid;
 	else
 		cpu = wwn->cmd_compl_affinity;