Skip to content

Commit

Permalink
[SCSI] scsi_transport_spi: fix sense buffer size error
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
James Bottomley authored and James Bottomley committed Jan 3, 2007
1 parent 8bcc241 commit 4ed381e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/scsi/scsi_transport_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4ed381e

Please sign in to comment.