summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-03-06 17:41:44 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-06 17:41:44 -0800
commitf716d8303345698728d9f8ce76a82a795a5be275 (patch)
tree20004f3dc2f11b83b5debe3a784d3f105c6e4daa
parent8ba7b0a14b2ec19583bedbcdbea7f1c5008fc922 (diff)
downloadblackbird-op-linux-f716d8303345698728d9f8ce76a82a795a5be275.tar.gz
blackbird-op-linux-f716d8303345698728d9f8ce76a82a795a5be275.zip
Allocate 96 bytes for SCSI sense data reply
The SCSI layer uses SCSI_SENSE_BUFFERSIZE (96) for the sense buffer size, even though some other code uses "sizeof(struct request_sense)" (which is 64 bytes). Allocate the buffer using the bigger of the two for safety. Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--drivers/scsi/sr_ioctl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/sr_ioctl.c b/drivers/scsi/sr_ioctl.c
index 5d02ff4db6cc..b65462f76484 100644
--- a/drivers/scsi/sr_ioctl.c
+++ b/drivers/scsi/sr_ioctl.c
@@ -192,7 +192,7 @@ int sr_do_ioctl(Scsi_CD *cd, struct packet_command *cgc)
SDev = cd->device;
if (!sense) {
- sense = kmalloc(sizeof(*sense), GFP_KERNEL);
+ sense = kmalloc(SCSI_SENSE_BUFFERSIZE, GFP_KERNEL);
if (!sense) {
err = -ENOMEM;
goto out;
OpenPOWER on IntegriCloud