Browse Source

[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 years ago
parent
commit
73b21174b2
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      src/net/tcp/iscsi.c

+ 2
- 1
src/net/tcp/iscsi.c View File

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

Loading…
Cancel
Save