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>
diff --git a/drivers/scsi/sr_ioctl.c b/drivers/scsi/sr_ioctl.c
index 5d02ff4..b65462f 100644
--- a/drivers/scsi/sr_ioctl.c
+++ b/drivers/scsi/sr_ioctl.c
@@ -192,7 +192,7 @@
SDev = cd->device;
if (!sense) {
- sense = kmalloc(sizeof(*sense), GFP_KERNEL);
+ sense = kmalloc(SCSI_SENSE_BUFFERSIZE, GFP_KERNEL);
if (!sense) {
err = -ENOMEM;
goto out;