Skip to contentSkip to conversation

target: Write NULL to *port_nexus_ptr if no ISID

PATCH New Bodo Stroesser 1 participant 1 message Apr 7, 2020 SCSI target

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 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.

---
 drivers/target/target_core_fabric_lib.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/target/target_core_fabric_lib.c +2 -1
index 6b4b354c88aa..f5f673e128ef 100644
@@ -341,7 +341,8 @@ static char *iscsi_parse_pr_out_transport_id(
 			*p = tolower(*p);
 			p++;
 		}
-	}
+	} else
+		*port_nexus_ptr = NULL;
 
 	return &buf[4];
 }
Signature · 1 line
2.12.3