Commit f716d830 authored by Linus Torvalds's avatar Linus Torvalds

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: default avatarLinus Torvalds <torvalds@osdl.org>
parent 8ba7b0a1
...@@ -192,7 +192,7 @@ int sr_do_ioctl(Scsi_CD *cd, struct packet_command *cgc) ...@@ -192,7 +192,7 @@ int sr_do_ioctl(Scsi_CD *cd, struct packet_command *cgc)
SDev = cd->device; SDev = cd->device;
if (!sense) { if (!sense) {
sense = kmalloc(sizeof(*sense), GFP_KERNEL); sense = kmalloc(SCSI_SENSE_BUFFERSIZE, GFP_KERNEL);
if (!sense) { if (!sense) {
err = -ENOMEM; err = -ENOMEM;
goto out; goto out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment