Przeglądaj źródła

[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 lat temu
rodzic
commit
73b21174b2
1 zmienionych plików z 2 dodań i 1 usunięć
  1. 2
    1
      src/net/tcp/iscsi.c

+ 2
- 1
src/net/tcp/iscsi.c Wyświetl plik

@@ -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

Ładowanie…
Anuluj
Zapisz