mirror of https://github.com/ipxe/ipxe.git
[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>pull/6/head
parent
a33298dcda
commit
73b21174b2
|
@ -337,6 +337,7 @@ static void iscsi_scsi_done ( struct iscsi_session *iscsi, int rc,
|
||||||
iscsi->command = NULL;
|
iscsi->command = NULL;
|
||||||
|
|
||||||
/* Send SCSI response, if any */
|
/* Send SCSI response, if any */
|
||||||
|
if ( rsp )
|
||||||
scsi_response ( &iscsi->data, rsp );
|
scsi_response ( &iscsi->data, rsp );
|
||||||
|
|
||||||
/* Close SCSI command, if this is still the same command. (It
|
/* Close SCSI command, if this is still the same command. (It
|
||||||
|
|
Loading…
Reference in New Issue