mirror of
https://github.com/adulau/aha.git
synced 2025-01-02 14:13:18 +00:00
[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>
This commit is contained in:
parent
c9d297c543
commit
e514385be2
1 changed files with 2 additions and 2 deletions
|
@ -342,12 +342,12 @@ int scsi_execute_req(struct scsi_device *sdev, const unsigned char *cmd,
|
||||||
sense = kmalloc(SCSI_SENSE_BUFFERSIZE, GFP_KERNEL);
|
sense = kmalloc(SCSI_SENSE_BUFFERSIZE, GFP_KERNEL);
|
||||||
if (!sense)
|
if (!sense)
|
||||||
return DRIVER_ERROR << 24;
|
return DRIVER_ERROR << 24;
|
||||||
memset(sense, 0, sizeof(*sense));
|
memset(sense, 0, SCSI_SENSE_BUFFERSIZE);
|
||||||
}
|
}
|
||||||
result = scsi_execute(sdev, cmd, data_direction, buffer, bufflen,
|
result = scsi_execute(sdev, cmd, data_direction, buffer, bufflen,
|
||||||
sense, timeout, retries, 0);
|
sense, timeout, retries, 0);
|
||||||
if (sshdr)
|
if (sshdr)
|
||||||
scsi_normalize_sense(sense, sizeof(*sense), sshdr);
|
scsi_normalize_sense(sense, SCSI_SENSE_BUFFERSIZE, sshdr);
|
||||||
|
|
||||||
kfree(sense);
|
kfree(sense);
|
||||||
return result;
|
return result;
|
||||||
|
|
Loading…
Reference in a new issue