Bläddra i källkod

[iscsi] Report SCSI response only when applicable

iSCSI generally includes a full SCSI response only when an error
occurs.  iscsi_scsi_done() currently passes the NULL response through
to scsi_response(), which ends up causing scsicmd_response() to
dereference a NULL pointer.

Fix by calling scsi_response() only if we have a non-NULL response.

Reported-by: Brendon Walsh <brendonwalsh@niamu.com>
Tested-by: Brendon Walsh <brendonwalsh@niamu.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 12 år sedan
förälder
incheckning
73b21174b2
1 ändrade filer med 2 tillägg och 1 borttagningar
  1. 2
    1
      src/net/tcp/iscsi.c

+ 2
- 1
src/net/tcp/iscsi.c Visa fil

@@ -337,7 +337,8 @@ static void iscsi_scsi_done ( struct iscsi_session *iscsi, int rc,
337 337
 	iscsi->command = NULL;
338 338
 
339 339
 	/* Send SCSI response, if any */
340
-	scsi_response ( &iscsi->data, rsp );
340
+	if ( rsp )
341
+		scsi_response ( &iscsi->data, rsp );
341 342
 
342 343
 	/* Close SCSI command, if this is still the same command.  (It
343 344
 	 * is possible that the command interface has already been

Laddar…
Avbryt
Spara