Disable SCSIRead() if no buffer provided. Some commands, like TEST_UNIT, don't read data from device

This commit is contained in:
Laurent Vivier 2006-11-01 17:43:48 +00:00
parent 1153cd593a
commit 5feb420909

View File

@ -71,11 +71,14 @@ int scsi_command(int target, char* cdb, int count, TIB_t* tib)
goto complete;
}
err = SCSIRead(tib);
if ((err != scPhaseErr) && (err != noErr))
if (tib != NULL)
{
printf("Cannot read data (%d)\n", err);
goto complete;
err = SCSIRead(tib);
if ((err != scPhaseErr) && (err != noErr))
{
printf("Cannot read data (%d)\n", err);
goto complete;
}
}
complete: