Commit 4ed381ee559ebfab32d3b21896c204992c36179a

Authored by James Bottomley
Committed by James Bottomley
1 parent 8bcc24127b

[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>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

drivers/scsi/scsi_transport_spi.c
... ... @@ -122,7 +122,7 @@
122 122 if (!sshdr)
123 123 sshdr = &sshdr_tmp;
124 124  
125   - if (scsi_normalize_sense(sense, sizeof(*sense),
  125 + if (scsi_normalize_sense(sense, SCSI_SENSE_BUFFERSIZE,
126 126 sshdr)
127 127 && sshdr->sense_key == UNIT_ATTENTION)
128 128 continue;