scsi: target: Write NULL to *port_nexus_ptr if no ISID

This patch fixes a minor flaw that could be triggered by a PR OUT RESERVE
on iSCSI, if TRANSPORT IDs with and without ISID are used in the same
command.  In case an ISCSI Transport ID has no ISID, port_nexus_ptr was not
used to write NULL, so value from previous call might persist.  I don't
know if that ever could happen, but with the change the code is cleaner, I
think.

Link: https://lore.kernel.org/r/20200408132610.14623-2-bstroesser@ts.fujitsu.com
Signed-off-by: Bodo Stroesser <bstroesser@ts.fujitsu.com>
Reviewed-by: Mike Christie <mchristi@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
Bodo Stroesser 2020-04-08 15:26:09 +02:00 committed by Martin K. Petersen
parent d6b23a7ce0
commit 13ef143ddd
1 changed files with 2 additions and 1 deletions

View File

@ -341,7 +341,8 @@ static char *iscsi_parse_pr_out_transport_id(
*p = tolower(*p);
p++;
}
}
} else
*port_nexus_ptr = NULL;
return &buf[4];
}