Skip to content

Commit 8fed04e

Browse files
BStroessermartinkpetersen
authored andcommitted
scsi: target: fix PR IN / READ FULL STATUS for FC
Creation of the response to READ FULL STATUS fails for FC based reservations. Reason is the too high loop limit (< 24) in fc_get_pr_transport_id(). The string representation of FC WWPN is 23 chars long only ("11:22:33:44:55:66:77:88"). So when i is 23, the loop body is executed a last time for the ending '\0' of the string and thus hex2bin() reports an error. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bodo Stroesser <[email protected]> Reviewed-by: Mike Christie <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 13ef143 commit 8fed04e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/target/target_core_fabric_lib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ static int fc_get_pr_transport_id(
6363
* encoded TransportID.
6464
*/
6565
ptr = &se_nacl->initiatorname[0];
66-
for (i = 0; i < 24; ) {
66+
for (i = 0; i < 23; ) {
6767
if (!strncmp(&ptr[i], ":", 1)) {
6868
i++;
6969
continue;

0 commit comments

Comments
 (0)