aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_transport_spi.c
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@steeleye.com>2006-12-11 10:47:06 -0500
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2007-01-03 17:57:35 -0500
commit4ed381ee559ebfab32d3b21896c204992c36179a (patch)
treeac0f8be42418ecb7a7b4b5d02b5bfa6e274e84fc /drivers/scsi/scsi_transport_spi.c
parent8bcc24127be12967588db0ad0e614be937ee1d5a (diff)
[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>
Diffstat (limited to 'drivers/scsi/scsi_transport_spi.c')
-rw-r--r--drivers/scsi/scsi_transport_spi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/scsi_transport_spi.c b/drivers/scsi/scsi_transport_spi.c
index 3fded4831460..014d7fea1ff3 100644
--- a/drivers/scsi/scsi_transport_spi.c
+++ b/drivers/scsi/scsi_transport_spi.c
@@ -122,7 +122,7 @@ static int spi_execute(struct scsi_device *sdev, const void *cmd,
122 if (!sshdr) 122 if (!sshdr)
123 sshdr = &sshdr_tmp; 123 sshdr = &sshdr_tmp;
124 124
125 if (scsi_normalize_sense(sense, sizeof(*sense), 125 if (scsi_normalize_sense(sense, SCSI_SENSE_BUFFERSIZE,
126 sshdr) 126 sshdr)
127 && sshdr->sense_key == UNIT_ATTENTION) 127 && sshdr->sense_key == UNIT_ATTENTION)
128 continue; 128 continue;