1
0
Fork 0

[SCSI] scsi_transport_spi: fix sense buffer size error

The code does this:

unsigned char sense[SCSI_SENSE_BUFFERSIZE];
...
scsi_normalize_sense(sense, sizeof(*sense), sshdr)

however the sizeof will return 1 not 96 which means the sense data will
have no valid ASC/ASCQ values.  Fix by putting the correct sense size.
The only affected case for this would have been the DV buffer sanity
check failure, which is fortunately quite rare.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
hifive-unleashed-5.1
James Bottomley 2006-12-11 09:47:06 -06:00 committed by James Bottomley
parent 8bcc24127b
commit 4ed381ee55
1 changed files with 1 additions and 1 deletions

View File

@ -122,7 +122,7 @@ static int spi_execute(struct scsi_device *sdev, const void *cmd,
if (!sshdr)
sshdr = &sshdr_tmp;
if (scsi_normalize_sense(sense, sizeof(*sense),
if (scsi_normalize_sense(sense, SCSI_SENSE_BUFFERSIZE,
sshdr)
&& sshdr->sense_key == UNIT_ATTENTION)
continue;