summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_lib.c
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@steeleye.com>2005-08-09 11:55:36 -0500
committerJames Bottomley <jejb@mulgrave.(none)>2005-08-28 11:34:12 -0500
commite514385be2b355c1f3fc6385a98a6a0fc04235ae (patch)
tree5506bb95c40532666552eef52566436d0551bed9 /drivers/scsi/scsi_lib.c
parentc9d297c543f379a27a34082070ed03a8ef846fc2 (diff)
downloadblackbird-op-linux-e514385be2b355c1f3fc6385a98a6a0fc04235ae.tar.gz
blackbird-op-linux-e514385be2b355c1f3fc6385a98a6a0fc04235ae.zip
[SCSI] fix sense buffer length handling problem
The new bio code was incorrectly converted from stack allocated to kmalloc'd buffer handling. There are two places where it incorrectly uses sizeof(*sense) to get the size of the sense buffer. This actually produces one, so no sense data was ever getting back, causing failure in things like disk spin up. Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/scsi_lib.c')
-rw-r--r--drivers/scsi/scsi_lib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 58da7f64c22f..72a47ce7a1d3 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -342,12 +342,12 @@ int scsi_execute_req(struct scsi_device *sdev, const unsigned char *cmd,
sense = kmalloc(SCSI_SENSE_BUFFERSIZE, GFP_KERNEL);
if (!sense)
return DRIVER_ERROR << 24;
- memset(sense, 0, sizeof(*sense));
+ memset(sense, 0, SCSI_SENSE_BUFFERSIZE);
}
result = scsi_execute(sdev, cmd, data_direction, buffer, bufflen,
sense, timeout, retries, 0);
if (sshdr)
- scsi_normalize_sense(sense, sizeof(*sense), sshdr);
+ scsi_normalize_sense(sense, SCSI_SENSE_BUFFERSIZE, sshdr);
kfree(sense);
return result;
OpenPOWER on IntegriCloud